Logout Code

Status
Not open for further replies.

sid_b6505

Broken In

Hi
Can any one help me in craeting a logout page in asp..so that clicking on the logout link..the user's session is terminated?
How do I create a session in asp for a logged in user such that other's can'y logon?

I m waiting eagerly for a response...

Siddharth
 

saROMan

QA Juggler
Taken From : *www.expinion.net/support/issue_view.asp?ID=501&CATE=15

I am not a ASP Guru ..so plz chk if the folowing code is any use to you or Not.....


Direct Logout Link:
Try adding this code where you want the words Log Out to appear.

Log Out




The code above presumes that the login.asp file is in the same directory as your protected page, you may have to change the path to something like the one below.

Log Out

If you are still having trouble, you can try the full path like this:
Log Out
The path depends on how your server is set up and how you have setup the folders on your site.

::::

Changing link with built-in check:
For sites that use the same menu / header for both member areas and non-member areas (like in our example area), you may want to have the option of linking to either the Logout or the Register area depending on whether or not the user is already logged in. (If they're already logged in, they don't want to register. If they are not already logged in, they certainly don't want to logout and they can login at the appropriate link that you've setup, but they may in fact need to register.)

You can clip the code from the mms/example/inc_header.asp file, but this is part of the header code below, with the portion in red being directly related to the logout function.

<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr>
<td width="200"> </td>
<td bgcolor="#C8CEE6" width="80%">
<table bgcolor="#ffffff" align="right" cellpadding="2" cellspacing="0" bordercolor="#808080" style="border: solid 1px;"><tr>
<td width="100" align="center">Home</td>
<td width="100" align="center">Any Members</td>
<td width="100" align="center">Group 1 or 5</td>
<td width="100" align="center">Help Me </td>
<% If Session("PMMS_IN") = "True" Then '// CHECK IF MEMBER IS LOGGED IN ALREADY %>
<td width="100" align="center">Log Out</td>
<% Else %>
<td width="100" align="center">Register</td>
<% End If %>
</tr></table>
 
Status
Not open for further replies.
Top Bottom