Jump to content

SESSION variables lost when URL masked


Okewood

Recommended Posts

Apologies if this has been covered before but much searching failed to find an answer.

I have a site (say "www.site1.com") that uses $_SESSION variables to hold login information, which works perfectly when accessed using its own URL.

I have another URL (say "www.site2.com") that my web host has redirected for me to www.site1.com and "masked", so that the www.site2.com URL is shown. Problem is, when accessing the site using the masked URL, $_SESSION doesn't hold its values between pages.

Anyone come across this before?

Link to comment
https://forums.phpfreaks.com/topic/242514-session-variables-lost-when-url-masked/
Share on other sites

Not personaly, but I can't imagin a situation where I would be using that kind of setup.  I would expect the issue is to do with the redirect from one domain to another, it would make sense that it does not maintain a perpetual connection between pages at the end user level.  You will probably need to use custom cookies to store the info on the client machine (assuming that it has cookies enabled) as a workaround.

Possibly - and a good thought. Complicated by the fact that the redirect includes a query_string element that acts as a switch so that www.site1.com displays the relevant images to create a "skin" pertinent to the "www.site2.com" client. And of course, I store these images in those SESSION variables too, so along with not being able to log in, the graphics are all missing as well!

Argghhh!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.