mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-01 07:57:14 +00:00
v2.9.0
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
2.8.11
|
2.9.0
|
||||||
@@ -14,7 +14,6 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
loginUserKey = "LOGIN_USER"
|
loginUserKey = "LOGIN_USER"
|
||||||
defaultPath = "/"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -59,8 +58,12 @@ func IsLogin(c *gin.Context) bool {
|
|||||||
func ClearSession(c *gin.Context) {
|
func ClearSession(c *gin.Context) {
|
||||||
s := sessions.Default(c)
|
s := sessions.Default(c)
|
||||||
s.Clear()
|
s.Clear()
|
||||||
|
cookiePath := c.GetString("base_path")
|
||||||
|
if cookiePath == "" {
|
||||||
|
cookiePath = "/"
|
||||||
|
}
|
||||||
s.Options(sessions.Options{
|
s.Options(sessions.Options{
|
||||||
Path: defaultPath,
|
Path: cookiePath,
|
||||||
MaxAge: -1,
|
MaxAge: -1,
|
||||||
HttpOnly: true,
|
HttpOnly: true,
|
||||||
SameSite: http.SameSiteLaxMode,
|
SameSite: http.SameSiteLaxMode,
|
||||||
|
|||||||
Reference in New Issue
Block a user