User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,663 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,871 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 263 | Replies: 1
Reply
Join Date: Dec 2007
Location: Bangalore,India
Posts: 118
Reputation: carobee is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
carobee carobee is offline Offline
Junior Poster

creating sessions time out

  #1  
Mar 25th, 2008
how can i set limit to my sessions in php so that if a page remains idle for certain time, the user is logged out?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Location: Cheshire, UK
Posts: 59
Reputation: cpickering is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
cpickering's Avatar
cpickering cpickering is offline Offline
/dev/null

Re: creating sessions time out

  #2  
Mar 25th, 2008
session_start();
setcookie("PHPSESSID",$_COOKIE['PHPSESSID'],time()+1800);
Where 1800 is the time in seconds before the session should expire. PHPSESSID is the default session ID. This way, every time a user loads a page they get their session extended.
Carl Pickering
Line3 Internet

I speak 1011 languages
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

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

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 1:45 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC