Current location: Hot Scripts Forums » Programming Languages » PHP » Your Session Has Ended!


Your Session Has Ended!

Reply
  #1 (permalink)  
Old 09-04-08, 12:58 AM
cancer10 cancer10 is offline
Wannabe Coder
 
Join Date: Oct 2006
Location: India
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Question Your Session Has Ended!

Hey,

You often see a message that says "You are logged out because your session has ended"

How do you check (in PHP) that the session has ended?


Thanx
Reply With Quote
  #2 (permalink)  
Old 09-04-08, 01:53 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
you simply check if a certain value is still set in the session (and you need to keep track of who's logged in in a database or flat file). As soon as the var is gone, you know the session has expired.

Often a script checks if a certain time has expired (say 10 minutes), and destroys the session itself, instead of the server destroying the session
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
destroy a session on different domain Deansatch PHP 4 07-31-08 04:19 AM
Prevent multiple logins using session id ramush PHP 2 07-01-08 12:46 PM
Session Security (Continued from post below) nova912 PHP 1 09-05-06 09:29 AM
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' Dr. Forensics PHP 3 07-15-06 03:54 PM
arrays passed via session rjwebgraphix PHP 1 01-22-06 08:00 PM


All times are GMT -5. The time now is 07:54 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.