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

adrienc921's avatar

Session reset on each request but on one controller only

Hello all,

I'm fairly new to the fantastic Laravel world! I've got a stange issue with Session management.

Sessions works perfectly on my Laravel Spark app: I can login and the session persist without any issue (so no issue with the session storage whatsoever). My only problem is on the WelcomeController (guest auth) where the session is refreshing (can see it on the cookie + on the csrf token) on each request.

I don't understand this behaviour. Just to be sure, I've replicated some code from another page (login) on which it works perfectly but as soon as I put it in my Welcome controller it lets me down.

Here is what I have in the moment (nothing ...) :

namespace App\Http\Controllers;
use Illuminate\Http\Request;

class WelcomeController extends Controller
{


    public function show()
    {
        return view('welcome');
    }

}

I guess its inherited. If you have any clue it would be highly appreciated :)

Thanks a lot for your help

Adrian

0 likes
2 replies
adrienc921's avatar

Hi Diego,

Yes it has! Otherwise session wouldn't work at all in spark? Sessions are created in the folder with right permissions, they persists when in the auth middleware. Thank you,

Please or to participate in this conversation.