Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Logging off from a website

Reply
Thread Tools

Logging off from a website

 
 
Geoff Wickens
Guest
Posts: n/a
 
      08-27-2003
I am amazed at how much help I have had in creating my first asp based
website from this forum. There are obviously a significant number of real
experts who are happy to take the time to help us novices. My site which now
does what it aims to would not be working without this assistance and I am
extremely grateful. Long may it continue!!!!!

My next problem is as below:

I have created a website where various categories of users can log on to get
at secure pages. I do this by checking usernames and passwords against a
list in a database and set session("loginadmin")=true or
session("loginctte")=true depending on what category is stored in my
database. On the secure pages I now want to put a log off button and am
interested to know what code I need.

Currently I have created a form and this calls a page (logouthandler.asp).
The code on this page is

<%
session("loginadmin")=false
session("loginctte")=false
response.redirect ("../index.asp")

%>

Does this do anything worthwile and is anything else recommended?

Geoff Wickens


 
Reply With Quote
 
 
 
 
Ken Schaefer
Guest
Posts: n/a
 
      08-27-2003
You can do that. However, if you end up having a large number of session
variables, then your code will become cumbersome to write. You could do:

<%
Session.Abandon
Response.Redirect(...)
%>

Cheers
Ken


"Geoff Wickens" <(E-Mail Removed)> wrote in message
news:szY2b.46$(E-Mail Removed)...
....
: I have created a website where various categories of users can log on to
get
: at secure pages. I do this by checking usernames and passwords against a
: list in a database and set session("loginadmin")=true or
: session("loginctte")=true depending on what category is stored in my
: database. On the secure pages I now want to put a log off button and am
: interested to know what code I need.
:
: Currently I have created a form and this calls a page (logouthandler.asp).
: The code on this page is
:
: <%
: session("loginadmin")=false
: session("loginctte")=false
: response.redirect ("../index.asp")
:
: %>
:
: Does this do anything worthwile and is anything else recommended?


 
Reply With Quote
 
 
 
 
Dan Brussee
Guest
Posts: n/a
 
      08-27-2003
On Wed, 27 Aug 2003 07:52:12 +0100, "Geoff Wickens"
<(E-Mail Removed)> wrote:
>I have created a website where various categories of users can log on to get
>at secure pages. I do this by checking usernames and passwords against a
>list in a database and set session("loginadmin")=true or
>session("loginctte")=true depending on what category is stored in my
>database. On the secure pages I now want to put a log off button and am
>interested to know what code I need.
>
>Currently I have created a form and this calls a page (logouthandler.asp).
>The code on this page is
>
><%
>session("loginadmin")=false
>session("loginctte")=false
>response.redirect ("../index.asp")
>
>%>


Just to make things simpler (in my opinion without seeing your other
code), I have typically used something like:

session("usertype") = "admin"

when logging on and then check the usertype session variable later
when trying to determine if a feature is available, etc

select case session("usertype")
case "admin":
case "ctte": ' huh?
case else: response.redirect "/index.asp"
end select

As already stated, all you need to do is abandon the session to "log
out" then.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Logging to a file and closing it again properly (logging module) Christoph Haas Python 1 06-14-2006 08:47 AM
Logging to a file and closing it again properly (logging module) Christoph Haas Python 0 06-12-2006 09:58 PM
logging buffered vs. logging history Christian Roos Cisco 4 02-05-2006 10:55 PM
java.util.logging, where to put logging.properties? janne Java 0 09-10-2004 10:18 AM
[java.util.logging] logging only to _one_ file Stefan Siegl Java 0 08-27-2003 12:29 PM



Advertisments