PHP Sessions and session_name()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
chrys
Forum Contributor
Posts: 118
Joined: Tue Oct 04, 2005 9:41 am
Location: West Roxbury, MA (Boston)

PHP Sessions and session_name()

Post by chrys »

Hi,

I don't know how to get around this, I've tried several methods.

When you create a session with a name, it will create a cookie with that name.

This cookie doesn't go away... so everything I do sesion_start it creates a new cookie with that name, eventually overloading the browser with this cookie to the point that sessions get messed up and my users have to clear their cookies.

Any one have any experience with this?
User avatar
chrys
Forum Contributor
Posts: 118
Joined: Tue Oct 04, 2005 9:41 am
Location: West Roxbury, MA (Boston)

Post by chrys »

Umm, yeah, it looks like if you use session_name, it doesn't overwrite the cookie once the session is re-instated. I stopped using session_name, and now PHPSESSID is the cookie name for life.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

:? post your code please. Something sounds screwy.
Post Reply