Home All Groups Group Topic Archive Search About

Cookies and subdomains and IE6

Author
22 Sep 2006 11:12 PM
stillworkingfortheman
I'm loosing cookies in IE6 (works in firefox) when with the following
steps...

step 1.  set a cookie in one domain, in an .aspx.cs codebehind...
           in www.domain.com/subdomain1/page1.aspx
           HttpContext.Current.Response.Cookies.domain = "domain.com";
           HttpContext.Current.Response.Cookies.Add(cookie);

step 2. Form post to an asp page in another
subdomain..www.domain.com/subdomain2/page2.asp

step 3. From www.domain.com/subdomain2/page2.asp, post form values back
to
           www.domain.com/subdomain1/page1.aspx

step 4. Try to access cookie from step one but cookie is lost/null, so
following line causes 'object reference not found error'.

string string1 =
HttpContext.Current.Request.Cookies["cookiename"].value;

I already checked to make sure all urls are http, not https.

Does anybody know why this works in firefox, but not IE?  Also, works
in IE if
try form post from localhost/subdomain1/page1.aspx to
www.domain.com/subdomain1/page2.aspx, then formpost back to
localhost/subdomain1/page1.aspx.

Thanks!

Author
23 Sep 2006 2:26 PM
Otis Mukinfus
Show quote Hide quote
On 22 Sep 2006 16:12:40 -0700, "stillworkingfortheman" <jule***@gmail.com>
wrote:

>I'm loosing cookies in IE6 (works in firefox) when with the following
>steps...
>
>step 1.  set a cookie in one domain, in an .aspx.cs codebehind...
>           in www.domain.com/subdomain1/page1.aspx
>           HttpContext.Current.Response.Cookies.domain = "domain.com";
>           HttpContext.Current.Response.Cookies.Add(cookie);
>
>step 2. Form post to an asp page in another
>subdomain..www.domain.com/subdomain2/page2.asp
>
>step 3. From www.domain.com/subdomain2/page2.asp, post form values back
>to
>           www.domain.com/subdomain1/page1.aspx
>
>step 4. Try to access cookie from step one but cookie is lost/null, so
>following line causes 'object reference not found error'.
>
>string string1 =
>HttpContext.Current.Request.Cookies["cookiename"].value;
>
>I already checked to make sure all urls are http, not https.
>
>Does anybody know why this works in firefox, but not IE?  Also, works
>in IE if
>try form post from localhost/subdomain1/page1.aspx to
>www.domain.com/subdomain1/page2.aspx, then formpost back to
>localhost/subdomain1/page1.aspx.
>
>Thanks!
Try microsoft.public.dotnet.framework.aspnet
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com



Post Thread options