Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 12-09-2008, 03:15 PM Session Timeout
Red_X_'s Avatar
Extreme Talker

Posts: 158
Location: Houston
Trades: 0
Essentially I want to make my sessions timeout after about 15minutes. I assume the code would look like this:

PHP Code:
ini_set("?session.gc_maxlifetime?"60*60); 
Although I am note entirely sure? (that math is for 1 hour btw)
__________________
"Good News Everyone, by reading this your hearing my voice."
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
 
Register now for full access!
Old 12-10-2008, 04:37 AM Re: Session Timeout
Galaxian's Avatar
Rich Powell

Posts: 842
Name: Rich Powell
Location: United Kingdom
Trades: 0
Hmm perhaps

PHP Code:
$_SESSION['started'] = time(); 
when setting the sessions

PHP Code:
if($_SESSION['started'] > (time()+(60*15))) {
session_destroy();

as a check every page load
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please help get the new
Please login or register to view this content. Registration is FREE
forum started for Webmasters like you!


Last edited by Galaxian; 12-10-2008 at 04:44 AM..
Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
Old 12-10-2008, 05:17 AM Re: Session Timeout
stoot98's Avatar
Ultra Talker

Posts: 427
Name: Stuart
Location: Glasgow, Scotland
Trades: 0
Should it not be...

PHP Code:

if($_SESSION['started']+(60*15) < time()) {
session_destroy();

stoot98 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Session Timeout
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11555 seconds with 12 queries