How are you processing the log in details? Most of the time you'll check the admin
username and password against values stored in the database (do a google on one-way
hashing if you're bothered about storing the password in plain text in the database)
and then if they're valid, set a session flag. For instance here's a little
pseudo-code for you :-
sUserName = request.form("sUserName")
sPassword = request.form("sPassword")
if sUserName = GetValueFromDB("sUserName") and sPassword = GetValueFromDB("sPassword")
then
Session("isAdministrator") = "1"
else
Session("isAdministrator") = "0"
end if
Then you can check in the admin pages to see if they're an administrator or not...
if Session("isAdministrator") = "1" then
'show admin buttons and do admin stuff here
else
'show a message telling them they're not an administrator, or just show normal
content here
end if
Dan
-----Original Message-----
From: nice guy [mailto:[EMAIL PROTECTED]
Sent: 12 August 2004 08:38
To: [EMAIL PROTECTED]
Subject: [ASP] Login cookies
hi guys, i have a problem in implementing cookies. i have a login page for admin. how
do i make sure tht other users don't get to access the administrator's pages. and i
also want to make certain buttons visible only when the administrator log in....
i don't have any idea in doing this.
thank you.
---------------------------------
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
[Non-text portions of this message have been removed]
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : [EMAIL PROTECTED]
Subscribe : [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~->
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : [EMAIL PROTECTED]
Subscribe : [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/active-server-pages/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/