Jump to content

[SOLVED] PHP Session-variables lose their values between subdomains


Recommended Posts

Hey guys,

 

This problem has bugged me for the longest time and I thought you guys could take me out of my misery.

 

The thing is, I have a php login script. The one from http://www.evolt.org/node/60384

 

And when a user logins into my site at the url and clicks remember me: alexville.com (without the www.) the new url after login is www.alexville.com.

 

But when they close their browser or just even go to alexville.com (without the www.) again they are not logged in.

 

This is probably a simple fix, and probably easier for someone that already knows this login script. Could someone give me a fix for this, because I am losing my mind!!!  ??? ??? ??? ??? ??? ??? ???

You need to play around with the session cookie's domain parameter in your php.ini, because as far as your browser knows, they're two separate domains unless you tell it otherwise.

 

The thing is, i'm on free hosting. So, is there some other way to do this? Or what should I tell my web hoster?

Pay for hosting then, because 99.99% of all free hosting ends up being crap.  You get what you pay for.

 

Thats not completely true. Even If I bought hosting, I still couldn't change the php.ini file because its on a shared server.

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.