Jump to content

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


alexville

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.

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.