{"id":5165,"date":"2012-03-21T11:01:27","date_gmt":"2012-03-21T05:31:27","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=5165"},"modified":"2012-03-21T11:01:27","modified_gmt":"2012-03-21T05:31:27","slug":"sharing-http-session-between-subdomains","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/sharing-http-session-between-subdomains\/","title":{"rendered":"Sharing HTTP Session between subdomains"},"content":{"rendered":"<p> Recently, I had a usecase to share same http session between different subdomains. The idea was that if a user is logged in on &#8220;<strong>somedomain.com<\/strong>&#8220;, he  need not to login again to go to <strong>subdomain.somedomain.com<\/strong>. The same http session should be usable. I started off on the wrong foot by looking into the SpringSecurity plugin, which I had been using. But, later on, I found that this is to be done by configuring the Tomcat. The solution is to configure tomcat to recongnize session cookies from the subdomains. So all it takes is to modify  element <strong>tomcat\/conf\/Context.xm<\/strong>l to:<br \/>\n[java]<br \/>\n &lt;Context sessionCookiePath=&quot;\/&quot; sessionCookieDomain=&quot;.yourdomain.com&quot;&gt;<br \/>\n[\/java]<\/p>\n<p> and you are good to go. The solution works for Tomcat version <strong>6.0.27<\/strong> and above.<\/p>\n<p>Cheers,<br \/>\nImran Mir<br \/>\nimran[at]intelligrape[dot]com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently, I had a usecase to share same http session between different subdomains. The idea was that if a user is logged in on &#8220;somedomain.com&#8220;, he need not to login again to go to subdomain.somedomain.com. The same http session should be usable. I started off on the wrong foot by looking into the SpringSecurity plugin, [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":10},"categories":[7],"tags":[108,773,17],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/5165"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=5165"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/5165\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=5165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=5165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=5165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}