• Status: Solved
  • Priority: Low
  • Security: Public
  • Views: 29
  • Last Modified:

Session handling differences between chrome and firefox

Hi,

I am using subdomains to organize logged in  / not.

I have configured the php.ini file within plesk and set
session.save_path = "/var/lib/php/session/wesbite"
session.cookie_domain = "website.com"

Open in new window


In chrome,the redirect to the subdomain is file and the session data is maintained
in firefox, the session data is empty

How can i get the session to be shared amongst all subdomains?
0
J N
Asked:
J N
  • 5
  • 3
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
PHP session cookies as written do not support subdomains.  Read this page to see what to do:  http://php.net/manual/en/function.session-set-cookie-params.php  And read the notes about how subdomains can be a problem.
0
 
J NUnicorn wranglerAuthor Commented:
Hi,

when i used

session.cookie_domain = ".website.com"

still have no luck with firefox
0
 
Dave BaldwinFixer of ProblemsCommented:
Are you putting that on every page before session_start() ?
0
 
J NUnicorn wranglerAuthor Commented:
Do i have to set the session params via php and set them in the php.ini file as well?

if i

 print_r(ini_get_all());

i get the following:

  [session.cookie_domain] => Array
        (
            [global_value] => .website.com
            [local_value] => .website.com
            [access] => 1
        )

Open in new window

0
 
J NUnicorn wranglerAuthor Commented:
Additionally, if it print_r(phpinfo());

i can see that the session cookie domain is set to ".website.com"
0
 
J NUnicorn wranglerAuthor Commented:
Seems to be no issues with chrome and safari its just firefox
0
 
J NUnicorn wranglerAuthor Commented:
I lied the session in firefox is empty
0
 
Dave BaldwinFixer of ProblemsCommented:
You lost me somewhere there.  On my websites, I do not have access to 'php.ini' because the sites are on shared hosting.  I always have to make changes in the PHP pages.  I haven't had to deal with subdomains but I have them one site so I could test it.  Without subdomains, sessions always act the same in all the browsers for me.

If you have it fixed, good.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now