PHP session time out on browser open -


i know there many threads regarding php sessions while ajax queries etc... problem is,

i have ajax grid (build after page load), allow edit when use logged on. don't mind session not checked until user change page (then valid_session.php called), have issue, when next day user opens browser on same page - grid still editable! if refresh page, user logged out.

i have no-cache set on pages, browsers (in particular chrome) don't reload on open.

i can't head around how force refresh on reopen. please guide me right direction...


edit

btw - found way handle this. 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 var set 0 - meaning session destroyed.     }); }); 

one solution set "last refreshed" cookie, , have javascript setinterval() checks if cookie older than, 20 minutes. if is, javascript triggers refresh. of course, still need log them out after inactivity period.


Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -