kakaajee
kakaajee

Reputation: 227

PHP session timeout issue

I am getting a session timeout all the time.

When ever a user is idle for some time, he has to re-login. I want him to login again only if he closes his browser. I have not used anything to destroy or unset the session, I only do that in the logout page.

I have set my PHP INI file to set all the session variables. You can browse the Session Variable here at the link.

http://www.providentfeed.com/phpinfo.php

Upvotes: 1

Views: 3152

Answers (2)

Naveed Ahmad
Naveed Ahmad

Reputation: 3175

you can write the following code in your php file.

// Session timeout value in seconds. Let's say we increase it to 24 hours
ini_set('session.gc_maxlifetime', 24*60*60);

Upvotes: 6

JohnP
JohnP

Reputation: 50029

That's standard behavior. If you want the user to be logged in indefinitely, you'll need to create a cookie and check for its presence in the login page. And simply log the user in if the cookie exists.

Upvotes: 1

Related Questions