DB Driven Authentication: Storing that variable

Results 1 to 3 of 3

Thread: DB Driven Authentication: Storing that variable

  1. #1
    Anastasis Guest

    Default DB Driven Authentication: Storing that variable

    I am using a database to store usernames & passwords (I will encrypt the pwds when I get this project done).<BR><BR>I would like to use ASP authentication (and VBS, for syntax).<BR>HOWEVER, I would like to store the Users Name somehow to use with other pages while he/she is logged on. <BR><BR>Scenario: User logs in, needs to add a record, delete a record, modify a record, etc, then logs out.<BR><BR>I want to pass their username to the field that needs to be added to the database w/o asking for it each time they need to do an action while logged in.<BR><BR>I hope this makes sense.<BR><BR>Heres what I have learned so far:<BR>creating a boolean session variable to contain wether they have logged in or not and creating a cookie with the username in it.<BR>if possible, how can i recall that cookie for use with another page?<BR><BR>&#060;code&#062;<BR> if strPassword = loginRS.Fields("Password").Value then<BR> Session("logged") = true<BR> Response.Cookie = strUserName<BR> Response.Redirect("loggedin.asp")<BR> else<BR> Session("logged") = false<BR> Response.Redirect("login.asp")<BR> end if<BR>&#060;/code&#062;<BR>the "strUserName" has been requested from the form and stored there, then HERE it is passed to the cookie.<BR><BR>Is there any way possible that I can get that value back out?<BR>Please, let me know.<BR><BR>Thanks<BR>Anastasis<BR>GL, GB, & GP<BR><BR><BR>

  2. #2
    Randy Guest

    Default RE: DB Driven Authentication: Storing that variabl

    Create the cookie:<BR>Response.Cookie("User") = strUserName<BR><BR>Then When you want to retrieve the information in the cookie<BR>dim strUser<BR>strUser = Request.Cookie ("User")<BR>Then you have full use of strUser.<BR><BR>Hope this helps

  3. #3
    Anastasis Guest

    Default Looks like it-I'll try it

    Thanks, Ill give it a try!<BR><BR>GL, GB, & GP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts