Logout Script

Logout Script

am 13.04.2008 10:06:00 von rhynos77

Hi there

I've set up password protected .asp pages in my FP2003 web following
instructions in article 825498.

I'd like users to be able to log out. However, I want a hyperlink to appear
only when the user is logged in.

As per article 825498 a small piece of script is inserted on all password
protected .asp pages to show a message that either says 'You are not logged
in' or their username if they are logged in.

<%
If Len(Session("UID")) = 0 Then
Response.Write "You are not logged on."
Else
Response.Write "" & Session("UID") & ""
End If
%>

Is there some way of modifying this 'Else' statement to include a link to
logout? Eg. when the user is logged in it says "You are logged in as
rhynos77. Click here to log out?

I'm a novice so I hope this makes sense.

Ryan

Re: Logout Script

am 13.04.2008 16:45:56 von Stefan B Rusynko

<%
If Len(Session("UID")) = 0 Then
Response.Write ""
Else
Response.Write "You are logged in as " & Session("UID") & ". "
End If
%>


Your yourloginoutpage.asp page only needs
<%
Session.Abandon
Response.Redirect "anyotherpage.asp"
%>


_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________


"rhynos77" wrote in message news:26AC8926-A4DD-4726-B1CD-231781B11621@microsoft.com...
| Hi there
|
| I've set up password protected .asp pages in my FP2003 web following
| instructions in article 825498.
|
| I'd like users to be able to log out. However, I want a hyperlink to appear
| only when the user is logged in.
|
| As per article 825498 a small piece of script is inserted on all password
| protected .asp pages to show a message that either says 'You are not logged
| in' or their username if they are logged in.
|
| <%
| If Len(Session("UID")) = 0 Then
| Response.Write "You are not logged on."
| Else
| Response.Write "" & Session("UID") & ""
| End If
| %>
|
| Is there some way of modifying this 'Else' statement to include a link to
| logout? Eg. when the user is logged in it says "You are logged in as
| rhynos77. Click here to log out?
|
| I'm a novice so I hope this makes sense.
|
| Ryan
|
|
|
|

Re: Logout Script

am 14.04.2008 06:55:01 von rhynos77

Hi Stefan

Thanks for your help! Much appreciated.

Ryan

"Stefan B Rusynko" wrote:

> <%
> If Len(Session("UID")) = 0 Then
> Response.Write ""
> Else
> Response.Write "You are logged in as " & Session("UID") & ". "
> End If
> %>
>
>
> Your yourloginoutpage.asp page only needs
> <%
> Session.Abandon
> Response.Redirect "anyotherpage.asp"
> %>
>
>
> _____________________________________________
> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
> "Warning - Using the F1 Key will not break anything!" (-;
> To find the best Newsgroup for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
> _____________________________________________
>
>
> "rhynos77" wrote in message news:26AC8926-A4DD-4726-B1CD-231781B11621@microsoft.com...
> | Hi there
> |
> | I've set up password protected .asp pages in my FP2003 web following
> | instructions in article 825498.
> |
> | I'd like users to be able to log out. However, I want a hyperlink to appear
> | only when the user is logged in.
> |
> | As per article 825498 a small piece of script is inserted on all password
> | protected .asp pages to show a message that either says 'You are not logged
> | in' or their username if they are logged in.
> |
> | <%
> | If Len(Session("UID")) = 0 Then
> | Response.Write "You are not logged on."
> | Else
> | Response.Write "" & Session("UID") & ""
> | End If
> | %>
> |
> | Is there some way of modifying this 'Else' statement to include a link to
> | logout? Eg. when the user is logged in it says "You are logged in as
> | rhynos77. Click here to log out?
> |
> | I'm a novice so I hope this makes sense.
> |
> | Ryan
> |
> |
> |
> |
>
>
>