Forum Moderators: coopster

Message Too Old, No Replies

domain spanning sessions

         

bleak26

1:40 pm on May 31, 2006 (gmt 0)

10+ Year Member



is it possible create sessions which span more than the domain they were created in. i understand how to add and remove variables from a session but this is beyond my knowledge. please could someone point me in the right direction

Sekka

1:59 pm on May 31, 2006 (gmt 0)

10+ Year Member



As far as I am aware, and I may be wrong, you can't do this. Sessions are unique to the server/domain they were created on.

eelixduppy

4:43 pm on May 31, 2006 (gmt 0)



I'm not sure what you want to accomplish, but can you submit your information with a form?

bleak26

6:52 pm on May 31, 2006 (gmt 0)

10+ Year Member



I have two web sites hosted on the same server, they have different domain names that are part of the same group of web sites eg:catsarefun.com & dogsarefun. I want a user who is logged into one, to be loged into the other , so they have a single sign on. I figure the best method is to somehow broaden the scope of the session but I do not know how to.

jatar_k

7:00 pm on May 31, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the problem is with the cookies, you can't access a cookie set by another domain

the sessions can be inserted and maintained in a single database and all the sites could use that, you would still need to figure out a way to recognize them

once they had a cookie for each domain you would be fine, just use the same session but they have multiple cookies

not sure what the best way to approach it would be

you could try setting a cookie for another domain, if it worked you wouldn't be able to access it but it would be set and usable on the other domain

coopster

7:59 pm on May 31, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



not sure what the best way to approach it would be

I would agree that multiple cookies using a shared database would be the approach, as you said. I would probably encrypt the cookie value (which might be the userid and username or some other unique data) as well as incorporate a secret key that is stored on the server outside the document root.

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. The encrypted cookie technique works fine.