statamic / v2-hub

Statamic 2 - Feature Requests and Bug Reports
https://statamic.com
95 stars 5 forks source link

Password prompt while browsing or error while uploading assets #2539

Open rrelmy opened 3 years ago

rrelmy commented 3 years ago

Describe the bug While browsing the asset library it can happen to show a password prompt just by changing the directory.

Also it can happen to show an "Unauthorized" error when a file is being uploaded.

TLDR: For me it looks like the amount of requests to /cp/assets/thumbnails/... to show thumbnails set a lot of cookies with different xsrf tokens which leads to session "corruption" (UI having outdated xsrf token)

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Assets'
  2. Click on a directory
  3. Maybe go back to the parent directory
  4. See prompt asking for the password

It helps to have a lot of images in the directories.

Expected behavior It just works without asking for the password.

Environment details (please complete the following information):

Additional context

Prompt during browse is caused by an error on the POST /cp/assets/browse request.

{
  "exception":"TokenMismatchException",
  "redirect":"https:\/\/---redacted---\/cp\/auth\/login?expired=1&referer=%2Fcp%2Fassets%2Fbrowse%2Fimg"
}
joshuablum commented 2 years ago

Hey @rrelmy,

This came up with another install again. Could you try changing your session driver to cookie and let us know if this continues to happen? In your .env file, change SESSION _DRIVER=file to SESSION DRIVER=cookie