Problem writing cookie when supplying Path property

Discussion in 'ASP General' started by Syed Ghayas, May 6, 2005.

  1. Syed Ghayas

    Syed Ghayas Guest

    Hi,
    I've been having problem writing a cookie. Everything goes ok but when I
    supply the .Path property to "/" It just write the cookie when there is no
    cookie present, but when I try to update the cookie (or overwrite the cookie)
    it doesnt change it.


    My requirement to supply the path to "/" because ASP.NET reads it. If I
    write the cookie without supplying the path, the ASP.NET pages are unable to
    read the cookie.


    Any help on this would be appreciated.

    Thanks in advance,

    Syed Ghayas
     
    Syed Ghayas, May 6, 2005
    #1
    1. Advertising

  2. Can you show us the code you're using to write the cookie as well as the
    code you're using to update it and read it?

    Ray at work

    "Syed Ghayas" <Syed > wrote in message
    news:...
    > Hi,
    > I've been having problem writing a cookie. Everything goes ok but when I
    > supply the .Path property to "/" It just write the cookie when there is no
    > cookie present, but when I try to update the cookie (or overwrite the

    cookie)
    > it doesnt change it.
    >
    >
    > My requirement to supply the path to "/" because ASP.NET reads it. If I
    > write the cookie without supplying the path, the ASP.NET pages are unable

    to
    > read the cookie.
    >
    >
    > Any help on this would be appreciated.
    >
    > Thanks in advance,
    >
    > Syed Ghayas
     
    Ray Costanzo [MVP], May 6, 2005
    #2
    1. Advertising

  3. Thanks for your interest.Here is the Code in ASP
    ASP Code:
    Response.Cookies("MyCookie")("Value")="ASP Cookie"
    Response.Cookies("MyCookie").Path = "/"

    here I am reading that cookie

    ..Net Code:
    HttpContext.Current.Server.UrlDecode(Request.Cookies["MyCookie"]["Value"]);

    Problem occur when I update cookie in ASP, and if I didn't mention the Path
    of the Cookie ASP updates the cookie but .Net return null.

    "Ray Costanzo [MVP]" wrote:

    > Can you show us the code you're using to write the cookie as well as the
    > code you're using to update it and read it?
    >
    > Ray at work
    >
    > "Syed Ghayas" <Syed > wrote in message
    > news:...
    > > Hi,
    > > I've been having problem writing a cookie. Everything goes ok but when I
    > > supply the .Path property to "/" It just write the cookie when there is no
    > > cookie present, but when I try to update the cookie (or overwrite the

    > cookie)
    > > it doesnt change it.
    > >
    > >
    > > My requirement to supply the path to "/" because ASP.NET reads it. If I
    > > write the cookie without supplying the path, the ASP.NET pages are unable

    > to
    > > read the cookie.
    > >
    > >
    > > Any help on this would be appreciated.
    > >
    > > Thanks in advance,
    > >
    > > Syed Ghayas

    >
    >
    >
     
    microsoft.public.dotnet.framework.aspnet, May 6, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U3llZCBHaGF5YXM=?=

    Problem writing cookie when supplying Path property

    =?Utf-8?B?U3llZCBHaGF5YXM=?=, May 6, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    454
    =?Utf-8?B?bWljcm9zb2Z0LnB1YmxpYy5kb3RuZXQuZnJhbWV3
    May 6, 2005
  2. sp
    Replies:
    3
    Views:
    716
    Philippe Poulard
    Jan 27, 2006
  3. Daniel Nichols
    Replies:
    6
    Views:
    433
    CBFalconer
    Jun 15, 2004
  4. Daniel Nichols
    Replies:
    5
    Views:
    464
  5. Torsten Mohr
    Replies:
    1
    Views:
    307
    Fredrik Lundh
    Jan 17, 2005
Loading...

Share This Page