Solved

About Cookies in ASP

Posted on 2000-03-16
4
250 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks,
Peerapol
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Classic ASP migration directions 7 57
post data with a link 8 49
Determining if Request.Form is empty 1 39
Classic ASP + JS 4 67
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…
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/…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now