Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing session vars

Status
Not open for further replies.

KingSlick

Programmer
Mar 9, 2007
45
US
I am wondering if there is a way to pass a session variable through to different virtual subdomains. Right now, I am using $_SESSION[userID], this is the variable that is used throughout the site meaning that a user is logged in. Now, I have a subdomain setup and want to be able to have the user remain seen as logged in when they enter the subdomain.

Thanks in advance.

SM
 
by subdomain do you mean you have a rela domain of
and you want subdomains of and If you do you need to set to cookie scope to fred.co.uk. Look in the php manual for the exact syntax. If not you might have to do some clever stuff passing the cookie around in hidden fields or in the URL
 
if you are really going cross domain rather than just subdomain then you need to pass the sessionID in the links or hidden form fields. and then use the ID to look up and instantiate a database based session store.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top