Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Session expires automatically after some amount of time in php

I am developing a simple php website named : http://www.dopanchat.com

In this site I used session to develop the login system, everything work fine but after some amount of time (for example, after 1 hour) the session expires automatically and user logged out from my site.

I don't know if it's server problem or anything else.

please help me to resolve this problem, you can check here : http://www.dopanchat.com

like image 799
Vijay Thakor Avatar asked Dec 15 '25 02:12

Vijay Thakor


1 Answers

Extending your session timeout is an approach but I won't recommend to expand it too much :)

Instead your application could detect user activities and refresh the session expiry time accordingly.

After all it doesn't really matter what is the session's timeout at some point user will lose the authentication due to the expired session.

Basically the expiry count down always starts after user's last action and not from the moment s/he logged in to your system.

like image 71
Ali Avatar answered Dec 16 '25 18:12

Ali



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!