mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-06-07 00:46:58 +03:00
GetCookiePath util function
This commit is contained in:
parent
bee5c54127
commit
38e4f5cbec
4 changed files with 12 additions and 16 deletions
|
@ -98,10 +98,7 @@ func Login(db store.IStore) echo.HandlerFunc {
|
|||
ageMax = 86400 * 7
|
||||
}
|
||||
|
||||
cookiePath := util.BasePath
|
||||
if cookiePath == "" {
|
||||
cookiePath = "/"
|
||||
}
|
||||
cookiePath := util.GetCookiePath()
|
||||
|
||||
sess, _ := session.Get("session", c)
|
||||
sess.Options = &sessions.Options{
|
||||
|
|
|
@ -103,10 +103,7 @@ func doRefreshSession(c echo.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
cookiePath := util.BasePath
|
||||
if cookiePath == "" {
|
||||
cookiePath = "/"
|
||||
}
|
||||
cookiePath := util.GetCookiePath()
|
||||
|
||||
sess.Values["last_update"] = now
|
||||
sess.Options = &sessions.Options{
|
||||
|
@ -217,10 +214,7 @@ func clearSession(c echo.Context) {
|
|||
sess.Options.MaxAge = -1
|
||||
sess.Save(c.Request(), c.Response())
|
||||
|
||||
cookiePath := util.BasePath
|
||||
if cookiePath == "" {
|
||||
cookiePath = "/"
|
||||
}
|
||||
cookiePath := util.GetCookiePath()
|
||||
|
||||
cookie, err := c.Cookie("session_token")
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue