Forum Moderators: open
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.
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.