Page 1 of 1
Domain Masking and Session Variables
Posted: Thu Sep 10, 2009 10:04 am
by tbasher15
I have a domain that is masked with godaddy.com and when I access my website with that domain name, the session variables do not work. If I access the website directly with the standard URL, everything works great.
From what I can tell, essentially every click that takes place on the website with the domain masked, a new session ID is created. So when the first page is accessed, a session id is created and my variables get set, as they should. But as soon as I click to another page, the session id changes and thus my variables no longer exist.
Any ideas on how to stablize that session ID and thus save my session variables?
Thanks!
Re: Domain Masking and Session Variables
Posted: Thu Sep 10, 2009 11:08 am
by Eric!
Is your browser blocking cookies from the godaddy.com domain?
Re: Domain Masking and Session Variables
Posted: Thu Sep 10, 2009 12:30 pm
by tbasher15
No.
Thanks for the reply.
Re: Domain Masking and Session Variables
Posted: Thu Sep 10, 2009 3:04 pm
by Eric!
Then there is probably something changing in the server php configuration. Check the environment variables for each condition via ini_get() for session data/path/config/etc. Otherwise you'll have to experiment and/or get godaddy to tell you what is going on.
Re: Domain Masking and Session Variables
Posted: Thu Sep 10, 2009 8:21 pm
by John Cartwright
I'm not exactly what you mean by your site is "masked by go-daddy". Are you sure this masking utility correctly saving the cookies and passing them on in subsequent requests?
Re: Domain Masking and Session Variables
Posted: Thu Sep 10, 2009 10:22 pm
by tbasher15
Godaddy allows you to forward a domain to any URL without pointing to DNS Servers.
For example:
http://www.myexample.com << can be forwarded to >>
http://www.someothersite.com/directory/file.php so that when you type in myexample.com it opens up the file.php. Without masking, this address would show in the address bar of your browswer (
http://www.someothersite.com/directory/file.php). Godaddy allows you to "Mask" the domain name so that when file.php is accessed with
http://www.myexample.com, (
http://www.myexample.com) appears in the address bar. Godaddy also allows you to enter page title and I think even meta tags when you mask which supersedes the title on the page.
Without session variables, I don't know what else I can use to maintain state and pass variables from page to page. POST and GET will not work in this scenerio. Are there any others?
Re: Domain Masking and Session Variables
Posted: Fri Sep 11, 2009 8:56 am
by Eric!
If godaddy is actually acting as a proxy for your site, then how it behaves is completely under their control. If Post and Get don't work either then there is no way to pass data between pages that I can think of. Perhaps you could do something on the client side with javascript.
Re: Domain Masking and Session Variables
Posted: Mon Sep 14, 2009 8:28 am
by tbasher15
The Solution:
I had a header("Location:
http://www.someothersite.com/Directory/nextfile.php") redirect on the landing page that the godaddy.com domain name (myexample.com) was directed to.
From what I can tell, some broswers must have been confused and creating two sessions. One for the masked domain name (myexample.com) and one for (someothersite.com).
Once I changed the header call to: header("Location: ../Directory/nextfile.php") it started working. I also added a session_write_close(); above the header redirect line. I read somewhere that helps to secure the session variables before the redirect.
Thanks for all your input!