From 4371c7877dfd3c0ac32bdecd34240b773a508212 Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Sun, 31 May 2020 14:34:42 +0000 Subject: [PATCH] Use base URL in cookies path --- src/routes/main.cr | 1 + 1 file changed, 1 insertion(+) diff --git a/src/routes/main.cr b/src/routes/main.cr index e739d82..7b05fd1 100644 --- a/src/routes/main.cr +++ b/src/routes/main.cr @@ -25,6 +25,7 @@ class MainRouter < Router token = @context.storage.verify_user(username, password).not_nil! cookie = HTTP::Cookie.new "token", token + cookie.path = Config.current.base_url cookie.expires = Time.local.shift years: 1 env.response.cookies << cookie redirect env, "/"