Ok, I was wrong :)
Thanks,
Ben
"Ben" <ben@online.nospam> wrote in message
news:RIGtc.764$pE2.657@fe37.usenetserver.com...[color=blue]
> Thanks for the fast response. I see what you're talking about, but I'm[/color]
not[color=blue]
> sure it applies to my problem.
>
> In my example code from my original post, I can read the cookie in asp.net
> and modify it at will. Asp can also read the cookie. As soon as asp
> modifies the cookie, asp.net can read but not modify the cookie. I can[/color]
see[color=blue]
> the cookie in asp.net after asp changed it. The value is there as[/color]
expected,[color=blue]
> but asp.net can no longer modify the cookie.
>
> Thanks,
> Ben
>
> "Steven Cheng[MSFT]" <v-schang@online.microsoft.com> wrote in message
> news:EOA0ZAGREHA.1516@cpmsftngxa10.phx.gbl...[color=green]
> > Hi Ben,
> >
> > From your description, you met the problem on sharing cookie value[/color][/color]
between[color=blue][color=green]
> > classic asp page and asp.net page, yes?
> >
> > As for this problem, I think it's a normal behavior because the ASP and
> > ASP.NET have differernt hehavior on dealing with the cookie's path. The
> > ASP.NET will by default set the Cookie's Path as "/", its the site's[/color][/color]
root[color=blue][color=green]
> > path while the ASP will set it as the "/appname" , the Application's
> > path(virtual dir). That's why when after we editing a cookie via ASP[/color][/color]
page,[color=blue][color=green]
> > we can never deal with it through ASP.NET page again( the path has been
> > corrupted and the ASP.NET can't correctly handled it).
> >
> > To resolve it, we can use either of the following means:
> > 1. If you want to follow the ASP's rule, than manually set the cookie's
> > path as "/appname", such as
> > Response.Cookies["newfoo"].Path = "/MyWebApp";
> > Response.Cookies["newfoo"].Value = "fooovalue";
> >
> > 2. Or set all the cookie's path as "/" in asp code, just like:
> > Response.Cookies("newfoo").Path = "/"
> > Response.Cookies("newfoo") = "aspValue"
> >
> > I prefer the #2 one, and I 've done a test via the following pages:
> >
> > ===================================
> >
> > ##fooo.aspx
> > if (Request.Cookies["newfoo"] != null)
> > {
> > Response.Write("<br>" + Request.Cookies["newfoo"].Domain);
> > Response.Write("<br>"+ Request.Cookies["newfoo"].Path );
> > Response.Write("<br>" + Request.Cookies["newfoo"].Value);
> > }
> > Response.Cookies["newfoo"].Path = "/";
> > Response.Cookies["newfoo"].Value = "fooovalue";
> >
> > Response.Write("<br><a href=\"fooo2.aspx\">fooo2.aspx</a>");
> > Response.Write("<br><a href=\"foo2.asp\">foo2.asp</a>");
> >
> >
> > ##fooo2.aspx
> > if (Request.Cookies["foo"] != null )
> > {
> > Response.Write("<br>" + Request.Cookies["newfoo"].Domain);
> > Response.Write("<br>"+ Request.Cookies["newfoo"].Path );
> > Response.Write("<br>" + Request.Cookies["newfoo"].Value);
> > }
> > Response.Cookies["newfoo"].Path = "/";
> > Response.Cookies["newfoo"].Value = "fooo2value";
> > Response.Write("<br><a href=\"fooo.aspx\">fooo.aspx</a>");
> >
> >
> >
> > ##foo2.asp
> > <%
> > for each cookie in Request.Cookies
> > Response.Write( cookie & "=" & Request.Cookies(cookie) & "Path:" &
> > "<br>")
> > next
> > Response.Cookies("newfoo").Path = "/"
> > Response.Cookies("newfoo") = "aspValue"
> > Response.Write("<br><a href=""fooo.aspx"">fooo.aspx</a>")
> > Response.End()
> > %>
> >
> > ===============================================
> >
> > That works ok. And here is a web link which has demonstrated the things[/color][/color]
I[color=blue][color=green]
> > mentioned above. Thanks.
> > #Cookie Behavior in Classic ASP-->ASP.NET
> >
http://www.eggheadcafe.com/PrintSear...asp?LINKID=639
> >
> >
> > Regards,
> >
> > Steven Cheng
> > Microsoft Online Support
> >
> > Get Secure!
www.microsoft.com/security
> > (This posting is provided "AS IS", with no warranties, and confers no
> > rights.)
> >
> > Get Preview at ASP.NET whidbey
> >
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
> >
> >[/color]
>
>
>[/color]