Skip to content

Admin panel login page doesn't work on WebKit (Safari, GNOME Web) #247

@m4tx

Description

@m4tx

When using Safari or GNOME Web (or likely any other Webkit-based web browser) the admin panel login page doesn't do anything useful when valid credentials are provided—instead, it just redirects back to the login page. This can be verified by using the admin example: https://github.com/cot-rs/cot/tree/master/examples/admin

The reason for that is that the Set-cookie header that is used to send the Session ID to the user has the Secure property set. Contrary to other popular browsers (Chrome/Firefox) and what MDN says, Webkit doesn't treat localhost in any special case and just ignores the Set-cookie header when HTTPS is not used on localhost.

One way to fix this would be to skip making the cookie Secure in the development mode. This would require creating a new config key to control this. It should still be true by default so that we have a sensible value for production systems.


Relevant WebKit bug reports:

https://bugs.webkit.org/show_bug.cgi?id=232088
https://bugs.webkit.org/show_bug.cgi?id=218980

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-libCrate: cot (main library crate)bugSomething isn't workinggood first issueGood for newcomers

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions