mardi 23 janvier 2018

Laravel 5.5: Sessions not working

I'm using Session::put('client', $id); to set a session value, which is persisting within the controller and elsewhere within the application, with the exception of a controller I'm calling via the API route via Vue.

I've since made the edit: 'driver' => env('SESSION_DRIVER', 'database') to the "session.php" file, and used the php artisan session:table to create the "sessions" table, none of which has changed anything, and there's nothing in the table itself, regardless of what I do to create additional session variables.

I've tried: $request->session()->get('client'), session('client'), and: Session::get('client') from within the controller, which in the first instance triggers an error (read the next paragraph), or returns nothing.

I've tried: Session::put('client', $id); Session::save(); which also didn't do anything.

I've tried: print_r( $request->session()->all() ); from within the controller, but got an error:

"Session store not set on request."

I am declaring the "Session" above the parent class of the method.

Any ideas?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire