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

samy918's avatar

“Session store not set on request.” with Google 2fa

Hi guys

I used a tutorial for implementing Google's 2FA: https://www.sitepoint.com/2fa-in-laravel-with-google-authenticator-get-secure/

The ValidateSecretRequest class extends from App\Http\Requests; but I don't have this class in my "Requests"-folder. So I used use Illuminate\Http\Request;

But when I call this class in the Controller I get an error.

RuntimeException - Session store not set on request …/vendor/laravel/framework/src/Illuminate/Http/Request.php 411

public function session()
     {
    if (! $this->hasSession()) {
        throw new RuntimeException('Session store not set on request.');
    }

    return $this->getSession();
 }´´´

Does anybody know how to handle?
0 likes
0 replies

Please or to participate in this conversation.