different between session_id and session_name

This is a multi-part message in MIME format.

------=_NextPart_000_007F_01C84D58.E724AB60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Sorry for the newbie,

is any one know the different between session_id() and session_name()?

I have 2 websites in same server.

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().

No problem when using different browser. But have this problem when =
using tab or new window in IE / Mozzila browser.


Regards,

Fairul Izham Bin Mohd Mokhlas
------=_NextPart_000_007F_01C84D58.E724AB60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dunicode">
<META content=3D"MSHTML 6.00.6000.16587" name=3DGENERATOR></HEAD>
<BODY id=3DMailContainerBody
style=3D"PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px"
bgColor=3D#ffffff leftMargin=3D0 topMargin=3D0 CanvasTabStop=3D"true"
name=3D"Compose message area">
<DIV><FONT face=3DArial size=3D2>Sorry for the newbie,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>is any one know the different between =
session_id()
and session_name()?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I have 2 websites in same =
server.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>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().</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>No problem when using different =
browser. But have
this problem when using tab or new window in IE /
Mozzila browser. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT><BR><BR>Regards,<BR><BR>Fairul =
Izham Bin
Mohd Mokhlas</DIV></BODY></HTML>

------=_NextPart_000_007F_01C84D58.E724AB60--
Fairul Izham [ Mi, 02 Januar 2008 09:02 ] [ ID #1898069 ]

Re: different between session_id and session_name

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
Shion [ Mi, 02 Januar 2008 10:58 ] [ ID #1898070 ]
PHP » alt.php » different between session_id and session_name

Vorheriges Thema: Last Day of Year Date Bug?
Nächstes Thema: Tags, quotes, textarea and mysql