Sessions...

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
jkashu
Forum Commoner
Posts: 45
Joined: Tue Jan 30, 2007 12:00 pm

Sessions...

Post by jkashu »

I am very unexperienced with sessions...

I'm using a login script that uses sessions. The problem is that if somebody logs into http://www.thewebsite.com and logouts from thewebsite.com/logout.php (no WWW is the key), they remain logged in.

Can I have the session recognized http://www.thewebsite.com and just http://thewebsite.com as the same thing????

Does this make sense?

Thanks!
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: Sessions...

Post by Zoxive »

That is because the cookie(For Session ID) is not being set to span across sub domains.

Change session.cookie_domain to ".domain.com" in php.ini or .htaccess

.htaccess

Code: Select all

php_value session.cookie_domain = ".domain.com"
jkashu
Forum Commoner
Posts: 45
Joined: Tue Jan 30, 2007 12:00 pm

Re: Sessions...

Post by jkashu »

When I put that line in the .htaccess file, it gives me a internal server error. Is there anything else I need to do? How do I change the php.ini?
thanks!
Post Reply