John
John

Reputation: 4944

Getting Logged Out During Navigation

I am using a PHP / MySQL login system. With a new browser session, I tend to get logged out as I navigate the site.

Any tips on how I can go about fixing this?

Thanks in advance,

John W.

Upvotes: 0

Views: 72

Answers (2)

Justin Lucas
Justin Lucas

Reputation: 2321

Sounds like the system is using sessions for persistent user logins which yes expire once the browser is closed. The solution is to use cookies for keeping track of users. You can extend the lifetime of a cookie for as long as you want and they are persistent through browser sessions.

Upvotes: 1

BarsMonster
BarsMonster

Reputation: 6585

Check expiration time on the cookies that PHP sends to browser. Set expiration time to 0 so that they are this-session-only (until user closes browser)

Upvotes: 0

Related Questions