Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Request.Querystring with Cookie

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…

861 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