跨域cookie更新? [英] Cross-domain cookie updating ?

查看:61
本文介绍了跨域cookie更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我猜这是对许多人来说这是一个可笑的显而易见的答案,但是对我来说不是
(而且我没有服务器或任何PHP知识能够

来试试吧)。它不是严格意义上的PHP问题,而是PHP

家伙会知道答案的问题。我想不出一个更合适的论坛

来试试。我听说ASP和JSP的人并不友好;-)


假设我们有一个来自域example.com的HTML页面,那个HTML

页面向example.com发出请求以返回JavaScript文件。自动(由浏览器)对该文件的

请求在请求标头中包含cookie

信息。如果返回的文件在响应头中有更新的cookie信息,那么我想,example.com的

cookies会更新(再次由
自动更新)
浏览器)。这就是我想象的事情是基于我读取的b
。我从未参与过服务器端脚本,只是在客户端更新cookie。但是我相信

响应标题中的更新cookie确实会导致cookie更新。


所以我的主要问题是,如果上面的场景略微

不同。如果它要求的JS文件实际上是一个

不同的无关域服务器(example2.com)那将要返回

a JavaScript文件更新后如何更新响应标头中的cookie。请问

浏览器是否正确更新了example2.com域名cookie?或者它会是b $ b认为它是想要更新的example.com cookie(因为JS文件

包含在他们所在页面的上下文中) ,这当然是域名example.com中的

解决方案

Stevo写道:
< blockquote class =post_quotes>
我猜这是对许多人来说这是一个可笑的显而易见的答案,但它不是给我的b $ b(而且我没有)服务器或PHP的任何知识能够

来试用它。它不是严格意义上的PHP问题,而是PHP

家伙会知道答案的问题。我想不出一个更合适的论坛

来试试。我听说ASP和JSP的人并不友好;-)


假设我们有一个来自域example.com的HTML页面,那个HTML

页面向example.com发出请求以返回JavaScript文件。自动(由浏览器)对该文件的

请求在请求标头中包含cookie

信息。如果返回的文件在响应头中有更新的cookie信息,那么我想,example.com的

cookies会更新(再次由
自动更新)
浏览器)。这就是我想象的事情是基于我读取的b
。我从未参与过服务器端脚本,只是在客户端更新cookie。但是我相信

响应标题中的更新cookie确实会导致cookie更新。


所以我的主要问题是,如果上面的场景略微

不同。如果它要求的JS文件实际上是一个

不同的无关域服务器(example2.com)那将要返回

a JavaScript文件更新后如何更新响应标头中的cookie。请问

浏览器是否正确更新了example2.com域名cookie?或者它会是b $ b认为它是想要更新的example.com cookie(因为JS文件

包含在他们所在页面的上下文中) ,域名example.com中的当然是




你是对的 - 它不是PHP题。试试javascript新闻组。


-

==================

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================


Jerry Stuckle写道:


Stevo写道:


>我猜这是对许多人来说这是一个可笑的显而易见的答案,但它不是给我的(我没有服务器或任何PHP的知识) />能够尝试)。它不是严格意义上的PHP问题,而是PHP人员会知道答案的东西。我想不出一个更合适的论坛。我听说ASP和JSP的人并不友好;-)

让我们说我们有一个来自域example.com的HTML页面,那个HTML
页面向example.com发出请求以返回JavaScript文件。自动(通过浏览器)对该文件的请求在请求标头中包含cookie
信息。如果返回的文件在响应标题中更新了cookie信息,那么我认为example.com的
cookie会更新(再次由
浏览器自动更新)。这就是我根据自己阅读的内容开展工作的方式。我从未参与过服务器端脚本,只是客户端更新cookie。但是我相信
响应标题中更新的cookie确实会导致cookie更新。

所以我的主要问题是,如果上面的情况略有不同会怎样。如果它要求的JS文件实际上是一个不同的不相关的域服务器(example2.com),它将返回一个带有响应头中更新的cookie的JavaScript文件。<浏览器是否会正确更新example2.com域cookie?或者它会认为它是想要更新的example.com cookie
(因为JS文件包含在他们所在页面的上下文中,
是当然在域example.com中。



你是对的 - 这不是一个PHP问题。试试javascript新闻组。



这肯定不是一个JavaScript问题,在这里执行没有JavaScript

。这是服务器端脚本编写者的问题。 PHP

程序员会做的事情。我会在JSP或ASP论坛上询问。


Stevo写道:


Jerry Stuckle写道:


>你是对的 - 这不是一个PHP问题。试试javascript新闻组。



这肯定不是一个JavaScript问题,在这里执行没有JavaScript

。这是服务器端脚本编写者的问题。 PHP

程序员会做的事情。我会在JSP或ASP论坛上询问。



以上回复是正常的Stuckle repsonse。


它应该被解释为我不知道答案:我的自我不会让我

考虑帽子我不知道关于PHP的一切:Ergo它不能关于PHP>


可悲的是,我也不知道答案。


I''m guessing this is a laughably obvious answer to many here, but it''s
not to me (and I don''t have a server or any knowledge of PHP to be able
to try it). It''s not strictly a PHP question, but something that PHP
guys would know the answer to. I can''t think of a more appropriate forum
to try. I''ve heard the ASP and JSP guys aren''t as friendly ;-)

Let''s say we have a HTML page from domain example.com, and that HTML
page makes a request to example.com to return a JavaScript file. The
request for that file automatically (by the browser) has cookie
information in the request header. If the file being returned has
updated cookie information in the response header, then I imagine the
cookies for example.com get updated (again automatically by the
browser). This is how I imagine things are working based on what I''ve
read. I''ve never been involved in server-side scripting, only
client-side updating of cookies. But I believe updated cookies in the
response header does cause cookie updating.

So my main question is, what if that scenario above is slightly
different. What if the JS file it''s requesting is actually to a
different unrelated domain server (example2.com) that''s going to return
a JavaScript file with updated cookies in the response header. Will the
browser correctly update the example2.com domain cookies ? Or will it
think it''s the example.com cookies that want to update (because JS files
get included in the context of the page they''re on, which is of course
in the domain example.com).

解决方案

Stevo wrote:

I''m guessing this is a laughably obvious answer to many here, but it''s
not to me (and I don''t have a server or any knowledge of PHP to be able
to try it). It''s not strictly a PHP question, but something that PHP
guys would know the answer to. I can''t think of a more appropriate forum
to try. I''ve heard the ASP and JSP guys aren''t as friendly ;-)

Let''s say we have a HTML page from domain example.com, and that HTML
page makes a request to example.com to return a JavaScript file. The
request for that file automatically (by the browser) has cookie
information in the request header. If the file being returned has
updated cookie information in the response header, then I imagine the
cookies for example.com get updated (again automatically by the
browser). This is how I imagine things are working based on what I''ve
read. I''ve never been involved in server-side scripting, only
client-side updating of cookies. But I believe updated cookies in the
response header does cause cookie updating.

So my main question is, what if that scenario above is slightly
different. What if the JS file it''s requesting is actually to a
different unrelated domain server (example2.com) that''s going to return
a JavaScript file with updated cookies in the response header. Will the
browser correctly update the example2.com domain cookies ? Or will it
think it''s the example.com cookies that want to update (because JS files
get included in the context of the page they''re on, which is of course
in the domain example.com).

You''re right - it''s not a PHP question. Try a javascript newsgroup.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


Jerry Stuckle wrote:

Stevo wrote:

>I''m guessing this is a laughably obvious answer to many here, but it''s
not to me (and I don''t have a server or any knowledge of PHP to be
able to try it). It''s not strictly a PHP question, but something that
PHP guys would know the answer to. I can''t think of a more appropriate
forum to try. I''ve heard the ASP and JSP guys aren''t as friendly ;-)

Let''s say we have a HTML page from domain example.com, and that HTML
page makes a request to example.com to return a JavaScript file. The
request for that file automatically (by the browser) has cookie
information in the request header. If the file being returned has
updated cookie information in the response header, then I imagine the
cookies for example.com get updated (again automatically by the
browser). This is how I imagine things are working based on what I''ve
read. I''ve never been involved in server-side scripting, only
client-side updating of cookies. But I believe updated cookies in the
response header does cause cookie updating.

So my main question is, what if that scenario above is slightly
different. What if the JS file it''s requesting is actually to a
different unrelated domain server (example2.com) that''s going to
return a JavaScript file with updated cookies in the response header.
Will the browser correctly update the example2.com domain cookies ? Or
will it think it''s the example.com cookies that want to update
(because JS files get included in the context of the page they''re on,
which is of course in the domain example.com).


You''re right - it''s not a PHP question. Try a javascript newsgroup.

It''s certainly not a JavaScript question, there''s no JavaScript being
executed here. It''s a server-side scripters'' question. Something a PHP
programmer would do. I''ll ask on a JSP or ASP forum then.


Stevo wrote:

Jerry Stuckle wrote:

>You''re right - it''s not a PHP question. Try a javascript newsgroup.


It''s certainly not a JavaScript question, there''s no JavaScript being
executed here. It''s a server-side scripters'' question. Something a PHP
programmer would do. I''ll ask on a JSP or ASP forum then.

The above response is a normal Stuckle repsonse.

It should be interpreted as "I dont know the answer: My ego won''t let me
consider hat I don''t know everything about PHP: Ergo it cannot be about PHP"

Sadly, I don''t know the answer either.


这篇关于跨域cookie更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆