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

satiseven777's avatar

laravel 5.3 session be destory after refresh page on host

my sessions works perfect on localhost but when I want to run on host it doesnt work and when user refresh the page,stored data in session is completely clean! I have searched on net but given answer did not helped me!

0 likes
6 replies
biishmar's avatar

@satiseven777

So u saying when user loggin in, session is destroying automatically..

try create a new session inside login and check that one..

show me the login code..

satiseven777's avatar

no,user cant login because session is like Flash session! session be create but destroy immediately!

adamprickett's avatar

First check is your 'domain' and 'path' values in config/session.php (domain may also be set via SESSION_DOMAIN in .env).

satiseven777's avatar

 if(session()->has('hassession')){
     echo "has session";
 }
 else{
     echo "has not";
     session(['hassession'=>'rrr']);
 }

Leandro3107's avatar

Hi My friend. Did you found out how to fix it? I am having the same problem

Please or to participate in this conversation.