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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remembering user name and password

Status
Not open for further replies.

wvdba

IS-IT--Management
Jun 3, 2008
465
US
hi,
i'm working on a page (or two) in at intranet. there's a main menu MENU.ASP where a user can go to PAGE1.ASP, enter user name and password, and presses a button to go to PAGE2.ASP which displays some rows from a database.
they can return to PAGE1.ASP using a return button or browser's back button. i would like to keep the user name and password when they return to PAGE1.ASP using return button or the back button so that the users do not have to re-type them every time. i have the pages going back and forth and the database listing portion works fine. but, when they return to PAGE1.ASP, the password and user id are gone. any suggestions? (this is sort of like ebay where by clicking a check a check box, it can keep you logged in for a day, so that you don't have to re-type user id and password every time. i have a hint that when they exit PAGE1.ASP, something must be done, but i'm not sure what that would be.
thanks much.
 
i got it figured out. here's how:
session variables in PAGE2.ASP is set to the value of user id and password using request.form
when it returns to PAGE1.ASP, user id and password fields are set to session variables that were set in PAGE2.ASP
note: without putting user id and password in PAGE1.ASP for the first time, it will not go to PAGE2.ASP
cheers.
 
Use a session variable to record when they have given correct name and password. Check at the start of each page for the session variable - only ask for login if variable is not set.

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
johnwm,
thanks for the info. that's something i had not thought out. i'm going to use that.
thanks.
 
another question is still unsolved. how would i validate user id and password. user id and password is in an access database. user types his user id and psw, clicks continue. i go to another asp program validate.asp that reads the table, compares values. if the values are ok, i go to page2.asp which displays the requested data. if user id and psw are not correct how do i return to the previous page with user id and psw and a msg that the userId/psw are incorrect?
thanks.
 
It's usually best to ask a new quetion in a new thread - see faq222-2244. However for this just use the If.. Then .. Else construction. If you are using VBScript then see
___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top