Login/Logout Functionality

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
WillUK
Forum Newbie
Posts: 24
Joined: Fri Nov 21, 2008 11:08 am

Login/Logout Functionality

Post by WillUK »

I'm building a login/logout function for an application, which should show 'login' if the session has not been started, but 'logout' if it has been started. It works fine until I move to another linked page within the application, and then the notation will only show 'login'.
I thought that the way to resolve this would be to simply apply the 'session_name();' and 'session_start();' funtions to each of the documents within the scope of the application (as I have done for both the login and logout scripts), yet this doesn't seem to have resolved the issue.

Could anyone point me in the right direction??

Thanks
WillUK
Forum Newbie
Posts: 24
Joined: Fri Nov 21, 2008 11:08 am

Re: Login/Logout Functionality

Post by WillUK »

Doh!!!! I've resolved it!! I was putting the session_start(); function in the wrong place!!!
Post Reply