Solved

Request.Querystring with Cookie

Posted on 2013-10-26
5
313 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 83

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 83

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 83

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

749 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