Solved

About Cookies in ASP

Posted on 2000-03-16
4
254 Views
Last Modified: 2008-02-20
Hello all experts,

I can only write my cookies, but cannot read its data. Does anyone know what's wrong in my code or I have to set some configuration at the server?

Here is my code:
[File SaveCookies.asp]
<%
  Response.Buffer = True
  Response.Cookies("Test").Expires = "June 20, 2000"
  Response.Cookies("Test").Secure = False
  Response.Cookies("Test")("Name") = "Peerapol"
%>


[File ReadCookies.asp]
<%
  Response.Buffer = True
  Name = Response.Cookies("Test")("Name")
  Response.Write(Name)
%>

When I run ReadCookies.asp, my browser will report error.
Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'Response.Cookies(...)'

Note: My server is Windows2000 Advanced Server, and uses IIS.

Thanks in advance,
Peerapol
0
Comment
Question by:Mr_Peerapol
  • 2
  • 2
4 Comments
 
LVL 4

Expert Comment

by:mberumen
ID: 2626502
MR. Peerapol

to read your cookies you need to use the request object

i.e.




                      [File ReadCookies.asp]
                      <%
                        Response.Buffer = True
                        Name =Request.Cookies("Test")("Name")
                        Response.Write(Name)
                      %>

regards
0
 
LVL 25

Author Comment

by:Mr_Peerapol
ID: 2626951
mberumen ,

Please post your comment as the answer, I will accept it.

Thanks,
Peerapol
0
 
LVL 4

Accepted Solution

by:
mberumen earned 50 total points
ID: 2628979
MR. Peerapol

if you look at your screen there will be a link on the right side of the comment that says "accept comment as an answer"

it is customary to post answers as comments.  if  that way more people can contribute to your solution.    

good luck

                      to read your cookies you need to use the request object

                      i.e.




                                            [File ReadCookies.asp]
                                            <%
                                              Response.Buffer = True
                                              Name =Request.Cookies("Test")("Name")
                                              Response.Write(Name)
                                            %>

                      regards
0
 
LVL 25

Author Comment

by:Mr_Peerapol
ID: 2630534
Thanks,
Peerapol
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP CDO - Limiting Connections 3 65
JQuery to parse xml string and get element by id 4 64
Button to go back 3 39
Replace value 2 34
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 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