fix: read cookieName-client if cookie with cookieName is not present

This commit is contained in:
Lakhan Samani 2021-12-11 06:45:15 +05:30
parent 00565c8717
commit 1761f41691

View File

@ -24,7 +24,10 @@ func SetCookie(gc *gin.Context, token string) {
func GetCookie(gc *gin.Context) (string, error) {
cookie, err := gc.Request.Cookie(constants.COOKIE_NAME)
if err != nil {
return "", err
cookie, err = gc.Request.Cookie(constants.COOKIE_NAME + "-client")
if err != nil {
return "", err
}
}
return cookie.Value, nil