Jump to content

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!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.