|
Posted by J.O. Aho on 01/02/08 09:58
Fairul Izham wrote:
> Sorry for the newbie,
>
> is any one know the different between session_id() and session_name()?
If you had read the online documentation you would know that session_id is the
random generated string, while session_name is the name of the cookie in where
the session_id is stored on the visitors browser (in case you use cookie,
which you seem to do from your description).
> But sometimes when the 1st website changes the session_id()
> using session_regenerate_id() then the 2nd website still follow
> the 1st website current session_id().
This for you use the same domain, and you can "always" access your own domains
cookies no matter if it's "site a" or "site b".
Do the following:
session_name('site_a');
session_start();
And on the other one:
session_name('site_b');
session_start();
Now the two "sites" will use different cookies to store the session id and
they can work as two independent entities.
See:
http://www.php.net/manual/en/function.session-name.php
--
//Aho
Navigation:
[Reply to this message]
|