Session problems...

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
sk8erh4x0r
Forum Commoner
Posts: 43
Joined: Wed May 26, 2004 8:27 pm

Session problems...

Post by sk8erh4x0r »

Background info:
sessions used
session_start(); located on scripts.php
scripts.php is included on every page.

For people not using IE:
Hidden Skills
User: test
Pass: test

Once you have logged in click on the members link (you stay logged in). Now click on the tutorials link or the submit link. Notice how you get logged out? Can anyone explain why this is happening?

Note that with Internet Explorer you DO stay logged in when accessing subdirectories but with firefox you don't.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

I'm logged in to http://hiddenskills.com not http://www.hiddenskills.com. The second page redirects me to www. If I get rid of the www. I'm logged in. You have to tell PHP to accept all domains at hiddenskills.com before session_start();

Use:

session_set_cookie_params ( int lifetime [, string path [, string domain [, bool secure]]] )

When you define your domain make sure it is a string:

.hiddenskills.com

The dot is important.

That should fix it.
Post Reply