![]() |
| ||
| Help with Last Activity Time Peace, I wrote a PHP File Contains a login form, If the user logs in a field will be inserted into the MySQL DataBase, So I want to make an automatic logout after 20 minutes idle. I wrote: <?phpI tried that and I encountered an error which does a logout to the user if he starts another hour.. Ex: Last_Activity= 59th Minute If he does a refresh in the 1st minute in the next hour it will logout, Who knows how to do that? |
| ||
| Re: Help with Last Activity Time try cookies. that might help you. this example from O'Reilly's Learning PHP5 (free: chapter 8) // The cookie expires one hour from now setcookie('short-userid','ralph',time( ) + 60*60); // The cookie expires one day from now setcookie('longer-userid','ralph',time( ) + 60*60*24); // The cookie expires at noon on October 1, 2006 setcookie('much-longer-userid','ralph',mktime(12,0,0,10,1,2006)); |
| ||
| Re: Help with Last Activity Time Quote:
|
| ||
| Re: Help with Last Activity Time then you will check it with cookies again and if the given time is up, redirect the page the username from availables list. |
| All times are GMT -4. The time now is 4:10 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC