when you set your cookies use the domain without the www. this way they will be available over the different subdomains
ie
header( "Set-Cookie: cookie_name=".$cookie_valu
Michael
Main Topics
Browse All TopicsWe currently have a main website that performs authentication (www.domain.com) using mod_auth_mysql against a mysql database. This website stores a cookie as well with user ID information.
We are setting up an application on a different server that is a subdomain (app.domain.com). The application has its own user table in its database but supports external authentication against a separate database using REMOTE_USER.
The problem is that since the application installation exists on a totally separate server, REMOTE_USER does not exist when the user browses from the main site to the application site. However, the domain cookie is readable.
I have code that parses the cookie, finds the user ID, does a mysql query and determines the username of the user. Is there a way, using PHP, to then use that username to populate REMOTE_USER so that authentication will be bypassed since the user has a valid cookie for the domain? Or any other way to utilize the cookie to bypass http authentication? We want the browsing experience for the main website and the application to be seamless.
Thanks!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
yea, I really should awake up before answering. Kinda read that part after I posted.
Anyway it's like the signup I use on a site that changes subdomains.
I set two domain wide cookies, one with the username, and the other a unique random number I called 'checksum' that when run through a MD5 will match a number stored in their user profile.
to verify them
select first_name from users where user_id=$user_id and login_checksum=MD5($_COOKI
NOTE: Both MySQL and PHP have MD5 functions. They do NOT return the same answers. Select one and always use it. There was also some talk about PHP5 MD5 function being changed. This won't be an issue if you set the checksum as each user logs in.
Michael
Well, as I said, both domains can read the cookie, so that's fine.
But the new app wants to read from the REMOTE_USER server variable, which gets set when people log into the main domain ... but is null when they switch to the app domain. So I'm looking for a way to set REMOTE_USER server variable, if it's even possible. I know who the REMOTE_USER should be since I can read the cookie and extract the username of the person from it; I just need to be able to set it.
Business Accounts
Answer for Membership
by: D4LyPosted on 2005-12-24 at 14:02:14ID: 15547829
I believe your question for seemlessness all boils down to:
Can you set the values of $_SERVER['PHP_AUTH_USER'] , $_SERVER['PHP_AUTH_PW'], and $_SERVER['AUTH_TYPE'] ?
ie:
is $_SERVER['PHP_AUTH_USER'] = $_COOKIE['username'];
allowed?
This answer I dont know...