session for sign out option

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
anishanmugam
Forum Newbie
Posts: 5
Joined: Sat Nov 15, 2008 3:20 am

session for sign out option

Post by anishanmugam »

Hi ,

Can anyone tell me how to create the session for signout option.

Thanks,
Anitha
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: session for sign out option

Post by califdon »

You'll have to ask a more specific question. If you want to learn about sessions, I suggest that you read http://www.tizag.com/phpT/phpsessions.php
anishanmugam
Forum Newbie
Posts: 5
Joined: Sat Nov 15, 2008 3:20 am

Re: session for sign out option

Post by anishanmugam »

While clicking signout option it should redirect to the home page also it should clear the values of existing username and password which is in home page.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: session for sign out option

Post by aceconcepts »

One way to do it would be to create a script named logout.php (or signout - whatever you like).

Have your logout button link to logout.php.

Within this script unset all the necessary session variables or if needs be you could destroy the entire session.

You'll then need to take the user back to the login page / home page.

Now that's your logic - all you need to do now is put it into practice.
Post Reply