<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>lizongbo at 618119.com &#187; jsessionid</title>
	<atom:link href="http://618119.com/tag/jsessionid/feed" rel="self" type="application/rss+xml" />
	<link>http://618119.com</link>
	<description>工作,生活,Android,前端,Linode,Ubuntu,nginx,java,apache,tomcat,Resin,mina,Hessian,XMPP,RPC</description>
	<lastBuildDate>Tue, 31 Jan 2012 14:25:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>解决iframe中jsessionid无法传递导致session丢失的问题</title>
		<link>http://618119.com/archives/2007/12/19/48.html</link>
		<comments>http://618119.com/archives/2007/12/19/48.html#comments</comments>
		<pubDate>Wed, 19 Dec 2007 00:35:46 +0000</pubDate>
		<dc:creator>lizongbo</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[jsessionid]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[sso]]></category>

		<guid isPermaLink="false">http://618119.com/archives/2007/12/19/48.html</guid>
		<description><![CDATA[在实现 ISMP2.1.1 接口的适合需要用到sso，而ISMP里定义的接口是需要在iframe等嵌入页面中调用sso接口，在实际开发中发现session无法正常传递。 重现问题的场景是： 1.先访问a站点:http://192.168.18.2/test.jsp test.jsp的代码为： &#60;html&#62; &#60;head&#62; &#60;title&#62; 618119.com &#60;/title&#62; &#60;/head&#62; &#60;body&#62; &#60;iframe src=&#8221;http://192.168.18.3/sso.jsp?ssoinfo=xxxx&#8220;&#62; &#60;/iframe&#62; &#60;/body&#62; &#60;/html&#62; sso.jsp里读取传递的ssoinfo,反向调用ISMP认证接口， 生成session，然后放入指定的属性值， session.setAttribute(&#8220;ssoUser&#8221;,&#8221;lizongbo&#8221;); 页面再重定向到 http://192.168.18.3/iframe.jsp response.sendRedirect(&#8220;/iframe.jsp&#8221;); iframe.jsp中读取session中ssoUser的属性值，会发现无法读取。 2.如果先访问了 192.168.18.3的页面，再访问192.168.18.2的页面，此时的iframe嵌入是可以传递已生成好的jsessionid Cookie. 因此解决的办法有： a.在url中加上jsessionid. 例如重定向到 response.sendRedirect(&#8220;/iframe.jsp;jsessionid=lizongbo&#8221;); 而这种情况下，如果iframe.jsp页面内的其它连接的url没有加上jsessionid, 也无法继续传递session，不过通过在客户端的js来为每个超连接的href属性重写加上jsessionid. b.sso.jsp里设置P3P头信息 例如 P3P: CP=&#8221;CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP [...]]]></description>
		<wfw:commentRss>http://618119.com/archives/2007/12/19/48.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

