Use httpOnly Cookie

This commit is contained in:
Jan Bader 2016-11-23 22:10:29 +01:00
parent fb97208785
commit b5c81aa956

View File

@ -79,7 +79,7 @@ func loginPost(c *gin.Context) {
c.AbortWithStatus(http.StatusUnauthorized) c.AbortWithStatus(http.StatusUnauthorized)
} }
c.SetCookie("authentication", t, (int)((expiration * time.Hour).Seconds()), "/", "localhost:8080", true, false) c.SetCookie("authentication", t, (int)((expiration * time.Hour).Seconds()), "/", "localhost:8080", true, true)
c.JSON(http.StatusOK, map[string]string{ c.JSON(http.StatusOK, map[string]string{
"token": t, "token": t,