Welcome to WebmasterWorld Guest from

Forum Moderators: phranque

Message Too Old, No Replies

Sessions in folders

1:20 pm on May 1, 2010 (gmt 0)

Junior Member

5+ Year Member

joined:Apr 15, 2010
posts: 126
votes: 0

I have an issue and unable to get the solution if anyone can help me please:

There is a subdomain abc.example.com having login link for SignIn once one signs In a session is created as:

$_SESSION['client']="store my session value";

and in my file .htaccess of the same subdomain abc i have .htaccess file having the code as:

php_value session.cookie_domain ".abc.example.com"

I am doing mode rewrite so even it is working fine there and i can share the same session from one subdirectory to another even on root but it is being losed if i am accessing from one more inner folder inside abc subdirectory.

It works fine only upto the levels of subdirectories but if there are further folders inside, sessions are being losed

[edited by: lammert at 5:18 pm (utc) on May 3, 2010]
[edit reason] changed domains to example.com [/edit]

12:12 pm on May 3, 2010 (gmt 0)

Senior Member from KZ 

WebmasterWorld Senior Member lammert is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 10, 2005
posts: 2951
votes: 33

Hi fahad, I may be a little bit confused, so maybe you are able to explain a little bit more to me. Are you talking about cookies not shared between subfolders, or between subdomains?

According to the original Netscape Cookie specification, sharing between different sub domains must be possible, even if the tail of the domain contains more than one step. For example def.xyz.abc.example.com and xyz.def.abc.example.com should receive the same cookies, if the cookie domain has been set to .abc.example.com.
8:10 pm on May 3, 2010 (gmt 0)

Junior Member

5+ Year Member

joined:Apr 15, 2010
posts: 126
votes: 0

Hi Lammert,
Thanks it works now but in one page only it is losing session value. Not getting why it is losing the value there where in all subdomains and subfolder being accessed.