CSS
-Tricks
treehouse :
what would you like to learn today?
Web Design
Web Development
iOS Development
Show search box
Search
Search in:
All
Articles
Forums
Snippets
Videos
✕
Home
Forums
Snippets
Gallery
Videos
Almanac
Demos
Lodge
Navigation 'n' Search
Forums
Illustration by Nick Sirotich
Forums
»
PHP Problems
Refresh Pages on Session Destroy
Manojsethi
Permalink to comment
#
July 2012
I want to refresh all pages if my session is destroyed from any of the page by clicking log-out.
piotrex41
Permalink to comment
#
July 2012
Maybe something like this:
header("Location: ".$_SERVER['PHP_SELF']);
$_SERVER['PHP_SELF'] = this is to complete the address,
If your address is
http://www.mypageiscool.com/page.php
$_SERVER['PHP_SELF'] = page.php
$_SERVER['HTTP_HOST'] =
http://www.mypageiscool.com/
ChrisxClash
Permalink to comment
#
July 2012
One simple option I can think of is doing a simple AJAX request every 5-20 seconds that would check the session and return false or something if it's destroyed, you can then refresh the page via jQuery.
Manojsethi
Permalink to comment
#
July 2012
@chrisxClash
:- Can You help me to give the demo of what you have told
Add a Comment
$_SERVER['PHP_SELF'] = this is to complete the address,
If your address is http://www.mypageiscool.com/page.php
$_SERVER['PHP_SELF'] = page.php
$_SERVER['HTTP_HOST'] = http://www.mypageiscool.com/