开发者

Same Domain iframe cookies

开发者 https://www.devze.com 2023-03-17 12:52 出处:网络
I have an image uploader (http://valums.com/ajax-upload/) that uses an iframe as a fallback for processing. My site uses cookies to store the user information. Will the cookie with the use开发者_Stack

I have an image uploader (http://valums.com/ajax-upload/) that uses an iframe as a fallback for processing. My site uses cookies to store the user information. Will the cookie with the use开发者_StackOverflowr information be passed onto the iframe (I need to know the user's id when processing the images). The iframed pages is on the same domain as where the cookie is generated.


Yes, if the iframe's source is the same domain as your parent page then any request originating from the iframe should send the same cookies.

Also, if you have Javascript being loaded into the iframe that should be able to access those domain's cookies as well.


If you set cookies like:

set-cookie: some-key=some-value; path=/;

YES

but if you use something like:

set-cookie: some-key=some-value; path=/;
set-cookie: some-key=; path=/ajax-upload/;

NO

0

精彩评论

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