Solved

Request.Querystring with Cookie

Posted on 2013-10-26
5
302 Views
Last Modified: 2013-10-27
I'm creating a membership renewal process whereby the users either enter their ID or do a lookup on their ID. Once verified, the client wants further verification through the entry of their email address and the use of social provider passwords. By adding that piece in between entry/lookup and retrieval/display of their member information, I can't figure out how to pass the key through. I've looked in to using a cookie, but don't know if/how to assign it to the recordset querystring. Is this the way to go or is there a better way of doing it - or is it even possible?
0
Comment
Question by:slegy
  • 3
  • 2
5 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39602971
Cookies are separate from the URL and querystring.  There is a short section here http://www.w3schools.com/asp/asp_quickref.asp on setting and getting cookiees.

You need to "Request Attention" and get the Classic ASP or the ASP.NET zones added to your question.  It's not really a Dreamweaver question.
0
 

Author Comment

by:slegy
ID: 39603050
Sorry, I find your categorization subjects very difficult to use.

The reason I made it a Dreamweaver question is because specifying the key for record retrieval when creating a recordset is where I am running into problems. Here's what I've done so far (that isn't working):
- I believe I've created the cookie containing the Member ID when it has been identified:
 sql = "SELECT * FROM Members WHERE memberID = '" & Trim(Request.Form("memberID")) & "'"
 Set rs=conn.Execute(sql)
memberID=rs("memberID")
Response.Cookies("memberID")=rs("memberID")
- in the detail display page, I've requested the cookie: Cookies.memberID
- this is the value that needs to be specified when creating the redordset:
   MMColParam - text - Request.Querystring("Cookies.memberID") - Default=AAAAA000

It doesn't work. Would a session variable be a better idea?
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 400 total points
ID: 39603097
"Request Attention" is a link right under your question above.  You can get the moderators to change or add Topic Areas to your question.

If you read the page I linked above, you will see that you need to use Request.Cookies() and not Request.Querystring() to read a cookie.  In addition you can not 'read' a cookie on the same page that it is set.  You will receive the cookie on the Next page request.
0
 

Author Closing Comment

by:slegy
ID: 39604066
Thank you for your help. It seems to be working. Although, as an aside, the "onload" funtions are not being executed. They worked fine before I added the "request cookie." I will submit this issue separately.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39604180
Request.Cookies() is executed on the server and "onload" is executed in the client's browser.  They normally have nothing to do with each other.  The only connection between the two would be if the Request.Cookies() code causes some variable that is passed to your javascript to change.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now