Forum Moderators: open

Message Too Old, No Replies

Sharing Session across domains

session id, are they the same across domains?

         

laserfiche

6:17 pm on Jun 6, 2005 (gmt 0)

10+ Year Member



We have two member sites, siteA.company.coom and siteB.company.com. We want users from one to be able to get to the other one without needing to re-login within the same session.

What we're thinking about doing is to store the session ID in a domain cookie and then check this ID with the current session ID when the person arrives the other site. e.g. i log in siteA and got session cookie 123, then i store it in cookie user@company[1].com, now when i click a link from siteA to siteB, i'll check the current session id and compare it with the sessionID stored in user@company[1].com to see if they match.

now here's my question. Is the session ID URL-independent? namely, would the session ID for siteA and the session ID for site B be the same if the user does not close their browser? in the above scenario, it would be whether the session ID when i'm in site B be 123 if i did not close the browser or would it be different since it's a different URL.

Thanks.

Jimmy Turnip

8:53 am on Jun 7, 2005 (gmt 0)

10+ Year Member



If you are using sql server you should really look at storing the session in sql server. The session state is called sql server mode.

Look it up on the msdn.

coopster

10:06 pm on Jun 7, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, laserfiche.

If the domain is the same you can indeed share cookies across the subdomains. Outside of that, you are best off using some server-side programming. There are alternative solutions for certain web servers that accommodate SSO (Single Sign On), but most that I have worked with are processor intensive and literally worthless, IMHO.