Results 1 to 2 of 2

Thread: Cookies and Database

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Angry

    Hello all. I need help. Here I am querying my DB and assigning the variables to the field I am joining it to.
    Then I am passing the values of the variables and assigning it to the session. Then finally I am plugging in the session values into the cookie I just created.

    Problem: The cookie gets created with the correct fields but not with the values passed down from the variables.

    What am I doing wrong here?


    If Request.Form("txtName") <> "" Then
    SQL = "Select * FROM Register WHERE " & "Register.userID='" & strUserID & _
    "' AND Register.password ='" & strPassword & _
    "' OR Register.FirstName ='" & strFirstName & _
    "' OR Register.LastName ='" & strLastName & _
    "' OR Register.Address ='" & strAddress & _
    "' OR Register.State ='" & strState & _
    "' OR Register.ZipCode ='" & strZipCode & _
    "' OR Register.PhoneNumber ='" & strPhoneNumber & _
    "' OR Register.Email ='" & strEmail & "'"


    cmdDC.CommandText = SQL
    Set RecordSet = Server.CreateObject("ADODB.Recordset")

    RecordSet.Open cmdDC, , 3, 3

    '-- If there is no record found skip this section and display current error page
    If Recordset.EOF Then
    Else
    Session("NewUserID") = strUserID
    Session("Password") = strPassword
    Session("FirstName") = strFirstName
    Session("LastName") = strLastName
    Session("Address") = strAddress
    Session("State") = strState
    Session("ZipCode") = strZipCode
    Session("PhoneNumber") = strPhoneNumber
    Session("Email") = strEmail

    Response.Cookies("ReclaimAmerica").Expires = Date+365
    Response.Cookies("ReclaimAmerica").Secure = FALSE
    Response.Cookies("ReclaimAmerica")("UserID") = Session("NewUserID")
    Response.Cookies("ReclaimAmerica")("Password") = Session("Password")
    Response.Cookies("ReclaimAmerica")("FirstName") = Session("FirstName")
    Response.Cookies("ReclaimAmerica")("LastName") = Session("LastName")
    Response.Cookies("ReclaimAmerica")("Address") = Session("Address")
    Response.Cookies("ReclaimAmerica")("State") = Session("State")
    Response.Cookies("ReclaimAmerica")("ZipCode") = Session("ZipCode")
    Response.Cookies("ReclaimAmerica")("Phone") = Session("Phone")
    Response.Cookies("ReclaimAmerica")("Email") = Session("Email")


    Response.Clear
    Response.Redirect "welcome.asp"
    Response.End

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Talking

    come on guys and ideas?

Posting Permissions

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



Click Here to Expand Forum to Full Width