Skip to content

Commit

Permalink
ws: Make cookie be a session cookie
Browse files Browse the repository at this point in the history
Although it really doesn't matter that much since we clear cookie's
on the server side anyway, make our cookie a session cookie, so
that it never gets stored in the browser.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
  • Loading branch information
stefwalter authored and mvollmer committed Sep 23, 2014
1 parent 242a996 commit 0d0c12d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ws/cockpitauth.c
Expand Up @@ -754,7 +754,7 @@ cockpit_auth_login_finish (CockpitAuth *self,
{
gboolean force_secure = !(flags & COCKPIT_AUTH_COOKIE_INSECURE);
cookie_b64 = g_base64_encode ((guint8 *)authenticated->cookie, strlen (authenticated->cookie));
header = g_strdup_printf ("CockpitAuth=%s; Path=/; Expires=Wed, 13-Jan-2021 22:23:01 GMT;%s HttpOnly",
header = g_strdup_printf ("CockpitAuth=%s; Path=/; %s HttpOnly",
cookie_b64, force_secure ? " Secure;" : "");
g_free (cookie_b64);
g_hash_table_insert (out_headers, g_strdup ("Set-Cookie"), header);
Expand Down

0 comments on commit 0d0c12d

Please sign in to comment.