我觉得这个问题是个很常见的问题,网站上会经常有这种需求。
set cookie好像不好用。
用户登录到A网站,在A网站的页面上,对B的2个请求,一个是通过Javascript的Ajax post,另外一个是window.open打开B网站的页面。按理说这2个请求应该是同一个sessionid
但是结果不是,好像cookie都不同,
【 在 ottffsse (nothing) 的大作中提到: 】
: 标 题: Re: 关于session id的一个问题
: 发信站: 水木社区 (Fri Jul 10 01:52:41 2015), 站内
:
: 1. see if the two requests' cookies are the same. if not, try to set cookies (esp. sessionIdInCookie) in latter pages to be the same as that of earlier pages.
: 2. overwrite the SessionIdMananger on the server.
:
:
: 【 在 allover (2012) 的大作中提到: 】
: : 自己做的一个网站(A网站)页面。简单的实现这么一个功能:
: : 1. 在A网站的一个页面上,要访问B网站。
: : 2. 在A网站的这个页面上,有2个按钮,第一个按钮click后,通过Ajax,post访问B网站某个servlet,取到一个信息。第二个按钮会window.open()打开一个B网站的页面,并且将上个取到的信息作为参数传递过去。这个要求这2次请求的sessionid相同。
: : ...................
:
: --
:
: ※ 来源:·水木社区
http://newsmth.net·[FROM: 183.95.135.*]
--
FROM 111.202.1.*