Solved

About Cookies in ASP

Posted on 2000-03-16
4
253 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

807 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