我想在持有身份验证令牌的客户端上放置一个 cookie。在他们使用凭据登录后,他们可以只发送令牌而不是凭据,直到服务器确定令牌已过期。
下面是 cookie 的构造函数。我正在使用restlets,不确定将“路径”和“域”设置为什么。这些领域的目的是什么?另外,如果我将“安全”设置为“真”,这是否意味着如果连接不是 https,它将不会传输 cookie?
public CookieSetting(int version,
String name,
String value,
String path,
String domain,
String comment,
int maxAge,
boolean secure,
boolean accessRestricted);
//'secure' - Indicates if cookie should only be transmitted by secure means.
//'accessRestricted' - Indicates whether to restrict cookie access to untrusted parties.
// Currently this toggles the non-standard but widely supported HttpOnly cookie parameter.