microcipcip / cookie-universal

Universal cookie plugin, perfect for SSR
524 stars 39 forks source link

remove in middleware not work #155

Open citrusjunoss opened 1 year ago

citrusjunoss commented 1 year ago
        if(isClient) {
          removeToken('f_token')
        }else {
          console.log('run in server')
          app.$cookies.remove('f_token')
        }
        console.log(app.$cookies.get('f_token'), 789)
image
freezyh commented 4 months ago

我也出现这情况,在服务端无法使用app.$cookies.remove无法生效

freezyh commented 4 months ago

@microcipcip

freezyh commented 4 months ago
        if(isClient) {
          removeToken('f_token')
        }else {
          console.log('run in server')
          app.$cookies.remove('f_token')
        }
        console.log(app.$cookies.get('f_token'), 789)
image

try it app.$cookies.set('f_token', '', { maxAge: -1, })