Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Problem writing cookie when supplying Path property

Reply
Thread Tools

Problem writing cookie when supplying Path property

 
 
=?Utf-8?B?U3llZCBHaGF5YXM=?=
Guest
Posts: n/a
 
      05-06-2005
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
 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      05-06-2005
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 http://www.velocityreviews.com/forums/(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
=?Utf-8?B?bWljcm9zb2Z0LnB1YmxpYy5kb3RuZXQuZnJhbWV3b3JrLmFzcG5ldA==?=
Guest
Posts: n/a
 
      05-06-2005
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.Cooki es["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 (E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
supplying runtime parameter sp XML 3 01-27-2006 08:42 AM
Need Help on Cookie.Path Property =?Utf-8?B?Qm95YW4=?= ASP .Net 0 05-18-2005 07:23 AM
Problem writing cookie when supplying Path property Syed Ghayas ASP General 2 05-06-2005 03:55 PM
Making function private/ not supplying declaration in header file Daniel Nichols C Programming 6 06-15-2004 05:03 AM
Making function private/ not supplying declaration in header file Daniel Nichols C Programming 5 06-15-2004 03:38 AM



Advertisments