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

jonshutt's avatar

"Session store not set on request" - only on one computer

I migrated a BE to Laravel a few weeks ago, uploaded, and it's working absolutely fine - for hundreds of users. But I've just started having an issue logging in on my own computer - the log in request is returning a message 'Session store not set on request.'

It was working fine, then I made a change to the front end and changed the URL of the log in form, went to test it - and getting that error. I've reverted the front end, same error. Same in incognito windows and other browsers. However, it's working absolutely fine on my phone, which is connected to the same WIFI.

I see around 30 entries in the sessions table - but nothing matches my IP address

Any ideas?

0 likes
7 replies
JussiMannisto's avatar

Are you trying to access the session on a route that doesn't use sessions, i.e. an API route? Or are you trying to access the session before the StartSession middleware has run?

jonshutt's avatar

@JussiMannisto I don't think so. The fact it's been working fine for weeks, and works on other devices makes me think it's a caching issue

Glukinho's avatar

Maybe local/dev is messing with production? And rewrites the same session?

jonshutt's avatar

Whatever it was - I've just tried locally, and on prod, and it's now working fine - I've changed nothing so maybe something around caching?

JussiMannisto's avatar

@jonshutt Hard to say without seeing any code or knowing what Artisan commands have been executed. Which session driver do you use: database, file, Redis, or something else?

jonshutt's avatar

@JussiMannisto

Code is below. I haven't run any artisan commands recently, not in the time when it broke/came back. Everything is pretty much default, looks like it's using database

config\session.php

'driver' => env('SESSION_DRIVER', 'database'),
public function loginWeb(Request $request)
    {
        $credentials = $request->validate([
            'email' => ['required', 'email'],
            'password' => ['required'],
        ]);

        if (Auth::attempt($credentials, $request->get('remember'))) {
            $request->session()->regenerate();

            return response()->json([
                'message' => 'ok',
                'remember' => $request->get('remember')
            ]);
        }

        return response()->json([
            'message' => 'Log in details incorrect. Please try again, or use the password reset form.',
        ],
JussiMannisto's avatar

@jonshutt I don't see any caching going on here, but I see you're returning JSON. In which file did you define the route? Can you show the route definition?

Please or to participate in this conversation.