Tomcat 6.0 doesn't set Cookies in webkit based browsers on localhost
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.
精彩评论