0

I launched an AWS EC2 instance with Ubuntu and installed Apache, MySQL and PHP 7. Everything working fine except the PHP session. This means I am able to log in & log out using the PHP session but the session does not expire automatically. This means If I log in today and shut down my machine and login again in the next day. my session persists. It never expires. Is there any configuration required to clear the session on idle time or anything?

The default session timeout is 30 minutes in PHP but it is not working.

Hkachhia
  • 4,463
  • 6
  • 41
  • 76
  • How do you start and expire the session? Can you show the code? – KIKO Software May 15 '23 at 07:30
  • after successful login, I started the session session_start(); – Hkachhia May 15 '23 at 07:35
  • It's better to put any code you have in the question itself. Anyway, if that's all the code there is, you could [read the top answer here](https://stackoverflow.com/questions/520237/how-do-i-expire-a-php-session-after-30-minutes). – KIKO Software May 15 '23 at 07:46
  • My question is why my session is not clear with default timeout. – Hkachhia May 15 '23 at 09:06
  • [This Q & A will help you for sure](https://stackoverflow.com/questions/15197826/session-timeout-issue-in-php) or [This Q & A](https://stackoverflow.com/questions/3476538/php-sessions-timing-out-too-quickly). Try these and put your progress here. –  May 15 '23 at 10:58

0 Answers0