Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8047057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:59:13+00:00 2026-06-05T05:59:13+00:00

I know there are many threads regarding PHP sessions while ajax queries etc… but

  • 0

I know there are many threads regarding PHP sessions while ajax queries etc…
but my problem is,

I have an ajax grid (build after the page load), which I allow to edit only when use is logged on. I don’t mind for session to be not checked until user actually change the page (then valid_session.php is called),
but I have an issue, when next day user opens the browser on the same page – the grid is still editable! obviously if I refresh the page, then user get logged out.

I have no-cache set on my pages, but browsers (in particular chrome) don’t reload it on open.

I can’t get my head around as how to force it to refresh on reopen. please guide me to the right direction…


EDIT

BTW – I found a way to handle this. I simply call session_destroy(); in session_destroy.php on unload() via $.get():

$(window).unload(function() {
    $.get('session_destroy.php', function(data) {
      alert(data); // alerts me of some var set to 0 - meaning session is destroyed.
    });
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:59:15+00:00Added an answer on June 5, 2026 at 5:59 am

    One solution is to set a “last refreshed” cookie, and have a javascript setInterval() which checks if the cookie is older than, say 20 minutes. If it is, the javascript triggers a refresh. Of course, you still need to log them out after the inactivity period.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there are many threads that talk about this problem but I don't
I know there are many similar threads out there pertaining to this but I
I understand there are many threads like mine but I have been trying to
I know there are many threads about calculating from lat/long to metric systems. This
I know there are many questions regarding font installation on android emulator. I'm sharing
I know there are many tutorials to use Dropbox as a Git repository, but
I know there are many questions similar but any of them didn't help. in
NOTE: I know there are many questions that talked about that but I'm still
I know there are already many questions like mine but I found no answer
Folks, I know there have been lots of threads about forcing the download dialog

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.