Solved

Request.Querystring with Cookie

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
unable to save new report from old one 9 28
Need to filter query and have subform updatable 2 26
sql statement - 9 24
Column Layout in Access Xp VBA Report 3 19
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

776 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