0

众所周知,当用户登录谷歌帐户时,如果在浏览器中禁用了 cookie,谷歌会向用户提示“激活 cookie”消息并限制登录。我希望为我的网站在java中实现相同类型的功能。我不明白怎么做。我用谷歌搜索了这个,但没有找到太多相关信息。如果我收到一些有价值的意见,那就太好了。提前致谢

4

1 回答 1

1

The only reliable test whether cookie are enabled or not is to try it out. Set a cookie on the home page of your app, redirect to another page and test if the cookie is set. This can be done both on the server side using the appropriate HTTP headers, or on the client using JavaScript.

于 2012-11-28T10:19:23.467 回答