Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bd089fe

Browse files
committed
use new way of setting cookie
1 parent aacc93e commit bd089fe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎http/web/routes/login.go‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"github.com/blobs-io/blobsgame/models/user"
66
"github.com/gofiber/fiber"
77
"strconv"
8+
"time"
89
)
910

1011
type LoginRequestBody struct {
@@ -37,8 +38,10 @@ func Login(ctx *fiber.Ctx) {
3738
ctx.Status(500).Write("an unknown error occurred")
3839
return
3940
}
40-
cookie.Expire = int(sessInt)
41-
ctx.Cookie("session", sess.SessionID, cookie)
41+
cookie.Name = "session"
42+
cookie.Value = sess.SessionID
43+
cookie.Expires = time.Unix(0, sessInt)
44+
ctx.Cookie(cookie)
4245

4346
ctx.Redirect("/app")
4447
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /