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

[file_server browse] Layout setting is not saved #6386

Open
trmdi opened this issue Jun 10, 2024 · 12 comments
Open

[file_server browse] Layout setting is not saved #6386

trmdi opened this issue Jun 10, 2024 · 12 comments

Comments

@trmdi
Copy link

trmdi commented Jun 10, 2024

When you change the file browser's layout between Grid/List, it's reset when you leave the current page/open other directory.
It would be better if the setting remains consistent until the user changes it.

@mholt
Copy link
Member

mholt commented Jun 10, 2024

Agreed. Can you suggest a good way to do that that doesn't require cookies?

@trmdi
Copy link
Author

trmdi commented Jun 10, 2024

Agreed. Can you suggest a good way to do that that doesn't require cookies?

I don't know what is better, what's wrong with the cookie?

@mholt
Copy link
Member

mholt commented Jun 10, 2024

Europe's laws make the use of cookies rather unbearable.

@aliasgar55
Copy link
Contributor

aliasgar55 commented Jun 10, 2024

Maybe local storage?

@trmdi
Copy link
Author

trmdi commented Jun 10, 2024

Europe's laws make the use of cookies rather unbearable.

Caddy is already using cookies, isn't it?
https://github.com/search?q=repo%3Acaddyserver%2Fcaddy%20cookie&type=code
So I think the EU's cookie law is not an issue here.

@mholt
Copy link
Member

mholt commented Jun 10, 2024

The only time we set cookies, AFAIK, are when the user explicitly configures load balancing policy as such. The rest of those results are related to parsing existing cookie headers, not setting.

@mholt
Copy link
Member

mholt commented Jun 10, 2024

Maybe local storage?

Maybe, but that will be lost when sharing a link. You will be viewing a grid and someone else will see the list.

@trmdi
Copy link
Author

trmdi commented Jun 10, 2024

The only time we set cookies, AFAIK, are when the user explicitly configures load balancing policy as such. The rest of those results are related to parsing existing cookie headers, not setting.

I saw there is a cookie for the Sorting button which is very similar to the Layout button.

@mholt
Copy link
Member

mholt commented Jun 10, 2024

Oh, interesting. I thought we got rid of those for query string parameters. In fact, I distinctly remember doing this... 🤔 We should probably remove those in favor of the query string.

@trmdi
Copy link
Author

trmdi commented Jun 12, 2024

Maybe local storage?

I think the cookie law is applied to similar types of cookie including localStorage.

@trmdi
Copy link
Author

trmdi commented Jun 12, 2024

Oh, interesting. I thought we got rid of those for query string parameters. In fact, I distinctly remember doing this... 🤔 We should probably remove those in favor of the query string.

Just curious why don't you accept the law? Maybe add an opton for caddy's admin to show/not show the cookie banner?
Because we can not avoid storing a user's preference in their browser. Anyway, clicking on the Accept Cookie button is not really a problem.

@mholt
Copy link
Member

mholt commented Jun 12, 2024

Cookie banners are destroying the Web.

I think we can avoid it with query strings. But it might be a little more involved since it requires changing the links.

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

3 participants