Welcome to WebmasterWorld Guest from 54.162.167.40

Forum Moderators: phranque

Message Too Old, No Replies

Sessions in folders

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

5+ Year Member



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_start();
$_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)

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



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)

5+ Year Member



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.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month