0

我正在尝试像这样更新 finatra 中的 cookie:

import com.twitter.finatra.Request
import com.twitter.finagle.Cookie

def updateCookie(req:Request, cookieName:String, newVal:String) = {
  // I tried also: 
  // req.response.removeCookie(cookieName)
  // req.response.addCookie(new Cookie(cookieName, newVal))
  req.response.cookies.update(cookieName, new Cookie(cookieName, newVal))
}

但它不工作。我在以下请求中获得的 cookie 值始终是旧的。有谁知道我做错了什么?

4

1 回答 1

0

I found it, it was that the cookies were in two different paths. Setting the right path solved the problem.

于 2015-01-27T08:08:29.110 回答