vendredi 22 février 2019

Error on unserialize() when decrypting laravel session cookie

I'm trying to decrypt a Laravel 5.7 session cookie (passed in the request), to authenticate users in a websocket.

use Illuminate\Support\Facades\Crypt;
...
$cookie = $request->get('session_cookie')
$sessionId = Crypt::decrypt($cookie);

However I always get:

unserialize(): Error at offset 0 of 40 bytes

I already tried clearing the cookies on the client, restarted the server and reset the app key with

php artisan key:generate



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire