Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Error 431 when navigating #34

Open
Levitskyi-M opened this issue Apr 6, 2020 · 3 comments
Open

HTTP Error 431 when navigating #34

Levitskyi-M opened this issue Apr 6, 2020 · 3 comments

Comments

@Levitskyi-M
Copy link

Levitskyi-M commented Apr 6, 2020

After a few minutes of navigation, the script stops working with HTTP error 431. The reason - cookie is too big. It is required to clear the cookie in the browser. If you comment out this line, the problem disappears.

phpfm/index.php

Line 712 in 84a3ee2

setcookie((string)$dir_cookiename, (string)$total_size, 0 , "/");

@dulldusk
Copy link
Owner

dulldusk commented Apr 29, 2020

The HTTP 431 Request Header Fields Too Large response status code indicates that the server refuses to process the request because the request’s HTTP headers are too long. The request may be resubmitted after reducing the size of the request headers.

I see.. since the cookie name is based on the folder, and stores the total size as cache. The length of the name and the number of cookies must be surpassing the webserver header default limits. I never got this error, but i have a sollution. I will change the cookie name to an MD5 to short the name. And if i create a function to check the header size and clear the older cookies, i can solve this forever. Without losing the cache functionality.

@dulldusk
Copy link
Owner

I will shorten the names for the ACE edit file mode too. And if this is not enough i can start using local storage for the cache, instead of cookies. This too would solve the problem forever.

@dulldusk
Copy link
Owner

For now, as a workaround, i released v1.7.9 using md5 to shorten the cookie names. On the latest github version i changed to crc32 hash, that uses only 8 chars for each name. But the real sollution is to use local storage, so this problem never happens again. And i know how to do it properly! Once i have time to spare, i will do it. And if someone is willing to make a donation of $30, i would take it as a job and deliver the update within 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants