开发者

Cookie with a path specified is not set via javascript

I have a local host called "myproject". When i try to set a cookie for resource "myproject/someresource" like this:

document.cookie = "mycookie=somevalue; path=/someresource";

IE does not set this cookie. But it does if i do not use path parameter:

document.cookie开发者_C百科 = "mycookie=somevalue";

What am i doing wrong?


according http://forum.de.selfhtml.org/archiv/2009/7/t189018/ the site must be within the specifed path. So I think you have to add a slash at the last position and you site must be in "http://mydomain.com/somesource/filename.datatype"

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜