Posted: Wed May 31, 2006 5:16 pm
When you say connection details, what are you talking about?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
You can set the session timeout in the php.ini file. You can also do something programatic -- for example every time they acccess a page you check to see if the time in a timestamp saved in a session variable has been passed. If it has not then save a timestamp an hour in the future to that var. If you have passed the save timestamp then clear the session vars and redirect to the login page.BigAbe wrote:1) How do I handle timeouts and/or specifying how long I want the user to stay "logged in"?
No. Keep as little as possible and only temporary data necessary to maintain session context for the user.BigAbe wrote:2) Do you recommend keeping the connection data in a session variable? I have one main index page with tons of include() statements, so I can easily just keep the connection details there, but if there's an easier/better way of doing it, I'd love to hear your thoughts.
Database connextion detailsEverah wrote:When you say connection details, what are you talking about?
Code: Select all
$_SESSION['var'] = 1;Code: Select all
$var = 2;Code: Select all
echo $_SESSION['var'];