1

Im using laravel 8 with jetstream authentication and bongodb before changing database from mysql to mongodb (using jenssegers/laravel-mongodb) it was everything work fine but when i use mongodb every post methode doesn't work it give me this erreur ('419 PAGE EXPIRED') i know where is the probleme exactlty is in this function

namespace Illuminate\Foundation\Http\Middleware;
protected function inExceptArray($request)
{
    foreach ($this->except as $except) {
        if ($except !== '/') {
            $except = trim($except, '/');
        }
        if ($request->fullUrlIs($except) || $request->is($except)) {
            return true;
        }
    }
    return false;
}

i dont know what i miss why it always return false

Hafsa
  • 29
  • 6
  • 1
    You're likely running into Laravel's [CSRF protection](https://laravel.com/docs/8.x/csrf#csrf-introduction) middleware. Are your sessions stored in the DB? If so, there is an issue with persisting session data, making the CSRF token lookup fail and result in the 419 error. – Aken Roberts Aug 31 '21 at 19:31
  • yes you are right thank you so much – Hafsa Aug 31 '21 at 20:10
  • 1
    I changed SESSION_DRIVER=database to SESSION_DRIVER=file in env file and it's work fine – Hafsa Aug 31 '21 at 22:57

1 Answers1

0

I changed to SESSION_DRIVER=fil and it worked for me