Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Login Security. 1

Status
Not open for further replies.

stlWebWiz

Technical User
Mar 7, 2005
12
0
0
US
Hello,

I'm wanting to make sure that a user cannot access any pages without first entering a username and password. Also if the user leaves my site, then returns, I would want the page to expire, or for them to have to login again. Is there a line of code that will do either of these. I'm using a login that is connected to access 2000. Any links to information on this or code snippets would be greatly appreciated.

Thanks
STLWW
 
You could use Session Variables to do this.
Code:
If Session("LoggedIn") <> True Then
  Response.Redirect "login.asp"
End If
Have your login 'action' page set the Session variable to True if the login is successful.

Tony
[red]_________________________________________________________________[/red]
Webmaster -
 
So I would have:

Form page (gets the info from user and post it to the action page)

The Action Page (determines of the login/password are good, and also sets the Session variable to True if login is successful)

The Secured Info Page (which would have the If Statement above.)

I think I'm understanding this, I'll give it a shot
 
This works like just like I wanted. Thank you very much for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top