开发者

Tomcat 6.0 doesn't set Cookies in webkit based browsers on localhost

开发者 https://www.devze.com 2022-12-24 21:46 出处:网络
I\'m working on a website that runs on Tomcat 6.0 at localhost:8080. Interestingly enough, Tomcat seems to only be able to set cookies on Firefox. Opera and WebKit based browsers (Chrome, WinSafari) s

I'm working on a website that runs on Tomcat 6.0 at localhost:8080. Interestingly enough, Tomcat seems to only be able to set cookies on Firefox. Opera and WebKit based browsers (Chrome, WinSafari) seem to fail. Is this a known issue and is there a开发者_JS百科 solution?


So the problem was we were using a blank string as our cookie domain value. This works in Firefox. I had tried changing the base to locahost and 127.0.0.1 but that hadn't worked previously. There are two reasons for this: the cookies spec requires domains to have 2 or 3 dots in them (hence localhost shouldn't technically work, even though it's aliased). Also, the app host base was localhost:8080, and it's been changed to 127.0.0.1:8080. This satisfies the same domain condition.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号