opcodesio / log-viewer

Fast and beautiful Log Viewer for Laravel
https://log-viewer.opcodes.io
MIT License
3.39k stars 237 forks source link

unserialize(): Error at offset 0 of 81 bytes #346

Open irtzamazhar opened 4 months ago

irtzamazhar commented 4 months ago

After setting up this package I faced unserialize(): Error at offset 0 of 81 bytes every time I reloaded my log-viewer route. It's working first time but if I refresh my page I get that error. After some googling, I got a solution and to regenerate APP_KEY will resolve it but still, if I refresh my page I get that issue.

image

MujeebAnwar commented 4 months ago

@irtzamazhar If you're not using Sanctum, you have to disable the EnsureFrontendRequestsAreStateful middleware in config/log-viewer.php. This middleware utilizes Sanctum's encrypt_cookies middleware if available; otherwise, it defaults to Laravel's EncryptCookies middleware. In Laravel's EncryptCookies middleware, serialize is false by default.

MNhat0308 commented 4 months ago

what if i use sanctum , error will show again? @MujeebAnwar

MNhat0308 commented 3 months ago

In middle EncryptCookies file set protected static $serialize = false; to false and it work well