PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1848
Number of posts: 5016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Sessions in regard to domain Posted by Cvele on 24 Dec 2010 at 5:55 AM
Hi!

I got following problem.
My PHP session is not the same for mysite.com and www.mysite.com. Ie, when user logs in to www.mysite.com, he is not automatically logged in to mysite.com and vice-versa.

I've tried using following code without any success:


session_set_cookie_params(0 , '/', '.mysite.com');
session_start();




... as well as:


ini_set('session.cookie_domain', '.mysite.com');
session_start();




... and as well as:


ini_set('session.cookie_domain', (strpos($_SERVER['HTTP_HOST'],'.') !== false) ? $_SERVER['HTTP_HOST'] : '');
session_start();




So, after trying to convince my host company to deal with this in php.ini, I am left without options known to me.

How do I deal with this?



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.