Skip to content

Commit 229a9b7

Browse files
committed
Add comment explaining cookie login issue over HTTP
Added a detailed comment describing why login fails when switching from HTTPS to HTTP due to browser restrictions on overwriting Secure cookies. This provides context for future debugging and development.
1 parent 7d697e3 commit 229a9b7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

webserver/http.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,13 @@ void http_assemble_response (Webserver_Request& webserver_request)
264264
// because it had the "SameSite=None" attribute but did not have the "Secure" attribute,
265265
// which is required in order to use "SameSite=None".
266266

267+
// If a user het logged into Bibledit via https,
268+
// and then next logs in via http, a plain connection,
269+
// then login fails.
270+
// The browser says this:
271+
// This attempt to set a cookie via a Set-Cookie header was blocked
272+
// because it was not sent over a secure connection
273+
// and would have overwritten a cookie with the Secure attribute.
267274
std::string identifier = webserver_request.session_identifier;
268275
if (identifier.empty ())
269276
identifier = filter::strings::get_new_random_string ();

0 commit comments

Comments
 (0)