Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Dhruv Sompura's avatar

I am logging out automatically before one day session

I added session lifeline to one day but still its logout before one day. can anyone please help me?

0 likes
3 replies
experimentor's avatar

@dhruv sompura A few more details will help in diagnosing the problem. Like your environment: is it local / production. On remote server? Or your machine? Please provide more details so that someone will solve the issue.

One issue I can think of is: Did you clear your browser cache? If you cleared all the cookies, you will have to login again.

1 like
Dhruv Sompura's avatar

Thanks @experimentor for the reply.

Environmen is production, its staging website. Yes i already cleared the cache. I have shared hosting,

I updated below code in .env file SESSION_LIFETIME=525600

I updated below code in config/session.php 'lifetime' => env('SESSION_LIFETIME', 525600) 'expire_on_close' => false

No i didnt cleared any cookie or cache from my browser at all. But still i am logged out before one day or i dont know exact hours.

Also i cleared laravel cache Artisan::call('cache:clear'); Artisan::call('config:clear'); Artisan::call('route:clear'); Artisan::call('view:clear');

experimentor's avatar

@dhruv sompura

Ok... let's investigate further. What is your session driver?

  • I think by default it is database. Did you run migrations / empty the sessions table?
  • If it is array, then there is no session persistence.
  • If it is file, did the file get deleted / replaced? If there is load balancing and multiple servers "file" driver is not the correct option.
  • if it is redis / memcached, did the cache get refreshed?

Please or to participate in this conversation.