Hi,

You can add last_request_time variable into the
session when user logs into the system. Initially set
the time at which user logs in to the system. Now
every user click you need to check your
last_request_time with the current_time. If the
difference of last_request_time and current_time is
greater than the thresold limit you have decided (idle
time of user) than just logout that particular user
otherwise set the current_time to the
last_request_time and proceed..

I hope the algorithm is clear to you.

Let me know if u need any help

thanks

Hardik Doshi


--- sunwei <[EMAIL PROTECTED]> wrote:
> Thanks a lot. Ye, I am using Apache. So how can I
> set when 
> the session expires? I should just set the
> "session.gc_maxlifetime" 
> item in php.ini file or I should write my program?
> 
> thanks!!
> 
> ----- Original Message ----- 
> From: "Kris Yates" <[EMAIL PROTECTED]>
> To: "sunwei" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 01, 2003 2:30 PM
> Subject: Re: [PHP] how can I logout autamaitcally
> (using session)
> 
> 
> > I presume you are running Apache. Apache cannot
> detect a browser
> > closing. The user would have to click a logout
> button, which would
> > execute session destroy or whatever and redirect
> them to another page.
> > That is what I do. My server is set to expire
> sessions after one hour.
> > So, if a user just closes the browser, it will
> eventually be deleted
> > automatically by Apache.
> > 
> > HTH
> > 
> > Kris
> > 
> > sunwei wrote:
> > 
> > >when the user close all the IE windows, should
> the session be destroyed autamatically? 
> > >it seems in my website, the session is not
> destroyed autamatically, so that other people 
> > >open the IE and see that he can access the
> website without logging in. so what I should do?
> > >
> > >thanks a lot for any help or suggestion.
> > >
> > >wei sun
> > >  
> > >
> > 
> > 
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to