diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-04-14 03:45:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-13 15:45:33 -0400 |
commit | 5b9557aef59b190c55de9ea218bf51152bc04786 (patch) | |
tree | d77004c983875886a00acd1561a74b8c3d5ce682 /routers/install | |
parent | b7221bec34fd49495234a18c26e4f5d81483e102 (diff) | |
download | gitea-5b9557aef59b190c55de9ea218bf51152bc04786.tar.gz gitea-5b9557aef59b190c55de9ea218bf51152bc04786.zip |
Refactor cookie (#24107)
Close #24062
At the beginning, I just wanted to fix the warning mentioned by #24062
But, the cookie code really doesn't look good to me, so clean up them.
Complete the TODO on `SetCookie`:
> TODO: Copied from gitea.com/macaron/macaron and should be improved
after macaron removed.
Diffstat (limited to 'routers/install')
-rw-r--r-- | routers/install/install.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/install/install.go b/routers/install/install.go index 8e2d19c732..8f8656230a 100644 --- a/routers/install/install.go +++ b/routers/install/install.go @@ -559,7 +559,7 @@ func SubmitInstall(ctx *context.Context) { } days := 86400 * setting.LogInRememberDays - ctx.SetCookie(setting.CookieUserName, u.Name, days) + ctx.SetSiteCookie(setting.CookieUserName, u.Name, days) ctx.SetSuperSecureCookie(base.EncodeMD5(u.Rands+u.Passwd), setting.CookieRememberName, u.Name, days) |