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

mozew's avatar
Level 6

why session cleared after refreshing page laravel

I have a little problem about sessions in Laravel.

I have made the authentication function which like this:

    $mobile = $request->session()->put('mobile',$request->mobile);
0 likes
1 reply
Cronix's avatar
Cronix
Best Answer
Level 67

Depending on what you are doing, $request->mobile might be null on refresh. You can easily check that.

1 like

Please or to participate in this conversation.