Forum Moderators: coopster

Message Too Old, No Replies

session drops from domain to subdomains

         

fahad direct

1:47 pm on Apr 30, 2010 (gmt 0)

10+ Year Member



if a client logs in from my domain.com session works well there but as far as he redirects from domain to subdomains session drops its values. Is there any of its solution to try with?

omoutop

1:56 pm on Apr 30, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



have you tried with cookies?

fahad direct

2:58 pm on Apr 30, 2010 (gmt 0)

10+ Year Member



No as cookies are created on client side and what if he has disabled?

eelixduppy

3:03 pm on Apr 30, 2010 (gmt 0)



What is the value of your session.cookie_domain directive?

fahad direct

3:27 pm on Apr 30, 2010 (gmt 0)

10+ Year Member



I am simply creating session on main domain and then using session_start(); function in subdomains pages. Could you please assist me if I am doing wrong?

eelixduppy

3:55 pm on Apr 30, 2010 (gmt 0)



If you change the session.cookie_domain to be less specific to a particular subdomain it should work. Just remove the subdomain on that value in your config file and see if that works (after restarting the server).

fahad direct

8:39 pm on Apr 30, 2010 (gmt 0)

10+ Year Member



Thanks for your help.

I have checked php ini file, in both local and master value it is showing as "No Value" how could i reset this value to my subdomain?

fahad direct

10:22 pm on Apr 30, 2010 (gmt 0)

10+ Year Member



I did some research on it and tried it to set it from within my code before i create session like:

ini_set("session.cookie_domain", ".mydomain_name.com");
session_start();
$_SESSION['client']="My session value";

This is the code i have put on mydomain_name but when i try to access it in subdomain as subdomain.mydomain_name.com it doesn't work.