opcodesio/log-viewer

unserialize(): Error at offset 0 of 81 bytes

irtzamazhar opened this issue · 4 comments

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

@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.

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

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