detect sslcookie set and no https

This is likely a misconfiguration and can cause login to fail as the
browser refuses the send the session cookie back over http.

Not entirely happy with putting the check where I did, since users have to
try to log in, and fail, to see the misconfiguration explained. But I could
not find a better place to put the check.
master
Joey Hess 2009-02-26 01:59:05 -05:00
parent 2e0dec2ffc
commit 158c6c3ac8
1 changed files with 6 additions and 1 deletions

View File

@ -142,7 +142,12 @@ sub cgi_postsignin ($$) {
exit;
}
else {
error(gettext("login failed, perhaps you need to turn on cookies?"));
if ($config{sslcookie} && ! $q->https()) {
error(gettext("probable misconfiguration: sslcookie is set, but you are attepting to login via http, not https"));
}
else {
error(gettext("login failed, perhaps you need to turn on cookies?"));
}
}
}