» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > PHP Programming and Tips

PHP Programming and Tips Discuss about PHP programming and Share Tips. Ask questions about Scripting and Errors.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-03-2006, 05:45 PM
croft croft is offline
OSP Starters
 
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
croft is on a distinguished road
Red face Executing function at session timeout

Hi
Is there any possibility in PHP5 to define a piece of code that gets executed when a user session is terminated because it timed out? Similar to a destructor of an object.
please reply
thanks -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-03-2006, 05:47 PM
31146dgreat 31146dgreat is offline
OSP Addicts
 
Join Date: Jun 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
31146dgreat is on a distinguished road
Default

It depends on your logic of logging out a user.

Mostly coders make create a session variable and check its value on all 'resitricted' pages and if session value is wrong means it is dead etc then they use header to bring user to the login form..

well if you are using this method too then it is very easy, please your code in this IF statement which redirects a user on session expiry.

but you can face a problem in this method that this script will also be executed for those people who will come directly to your restricted page.. so even their session was never created but this script will be called..

the other option is to create a timestamp when session is created and keep checking the current time, if your session expiry time is 24 mins in php.ini file when it collects garbage and destroys session.. make your script to execute your desired script after 24 mins.

so when session will destroy your script will b -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP session hacking webspider PHP Programming and Tips 3 08-23-2006 02:39 PM
session variable overwriting euhoria PHP Programming and Tips 2 08-22-2006 02:01 PM
Security Safe PHP Session Setup waugh PHP Programming and Tips 2 08-03-2006 06:03 PM
New session not generated furious PHP Programming and Tips 1 08-01-2006 05:51 PM
stop indexing PHP SESSION IDs danielle Yahoo 4 03-26-2006 06:34 AM


All times are GMT. The time now is 11:39 PM.