Skip to content

Commit

Permalink
ws: Give our cookie a simpler name: cockpit
Browse files Browse the repository at this point in the history
When embedding, people will probably start using this cookie's name
explicitly, so keep it simple and straightforward.

Closes #1234
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
  • Loading branch information
stefwalter authored and mvollmer committed Sep 23, 2014
1 parent 0d0c12d commit 90b46a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ws/cockpitauth.c
Expand Up @@ -606,7 +606,7 @@ authenticated_for_headers (CockpitAuth *self,
if (!cockpit_web_server_parse_cookies (in_headers, &cookies, NULL))
return NULL;

cookie = base64_decode_string (g_hash_table_lookup (cookies, "CockpitAuth"));
cookie = base64_decode_string (g_hash_table_lookup (cookies, "cockpit"));
if (cookie == NULL)
return NULL;

Expand Down 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=/; %s HttpOnly",
header = g_strdup_printf ("cockpit=%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 90b46a1

Please sign in to comment.