Logout Script

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 "<b>You are not logged on.</b>"
Else
Response.Write "<b>" & Session("UID") & "</b>"
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
rhynos77 [ So, 13 April 2008 10:06 ] [ ID #1941503 ]

Re: Logout Script

<%
If Len(Session("UID")) = 0 Then
Response.Write "<a href='yourloginpage.asp'>You are not logged on. Log In</a>"
Else
Response.Write "You are logged in as " & Session("UID") & ". <a href='yourloginoutpage.asp'> Click here to log out</a>"
End If
%>


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


_____________________________________________
SBR [at] 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" <rhynos77 [at] discussions.microsoft.com> wrote in message news:26AC8926-A4DD-4726-B1CD-231781B11621 [at] 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 "<b>You are not logged on.</b>"
| Else
| Response.Write "<b>" & Session("UID") & "</b>"
| 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
|
|
|
|
Stefan B Rusynko [ So, 13 April 2008 16:45 ] [ ID #1941509 ]

Re: Logout Script

Hi Stefan

Thanks for your help! Much appreciated.

Ryan

"Stefan B Rusynko" wrote:

> <%
> If Len(Session("UID")) = 0 Then
> Response.Write "<a href='yourloginpage.asp'>You are not logged on. Log In</a>"
> Else
> Response.Write "You are logged in as " & Session("UID") & ". <a href='yourloginoutpage.asp'> Click here to log out</a>"
> End If
> %>
>
>
> Your yourloginoutpage.asp page only needs
> <%
> Session.Abandon
> Response.Redirect "anyotherpage.asp"
> %>
>
>
> _____________________________________________
> SBR [at] 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" <rhynos77 [at] discussions.microsoft.com> wrote in message news:26AC8926-A4DD-4726-B1CD-231781B11621 [at] 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 "<b>You are not logged on.</b>"
> | Else
> | Response.Write "<b>" & Session("UID") & "</b>"
> | 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
> |
> |
> |
> |
>
>
>
rhynos77 [ Mo, 14 April 2008 06:55 ] [ ID #1941933 ]
Microsoft » microsoft.public.frontpage.client » Logout Script

Vorheriges Thema: Test
Nächstes Thema: slideshow pictures