Discussion:
Browser not sending cookie information to server
(too old to reply)
junOnline
2006-01-17 23:01:02 UTC
Permalink
Hi, I am developing an asp.net 2.0 application using visual studio 2005 on my
computer and I am getting very inconsistent results when I test on my
computer versus from other computers.

The symptom of the problem is that the web server does not receive cookie
information from the browser after I have properly logged in to the web
server. Without this information, my session state keeps on getting lost and
the authentication logic sends me back out to the login page.

Using Fiddler, I have narrowed down the problem to what I think is the
browser not always sending cookie information (containing the session and
authentication ticket) to the web server.
This is what I have tried:
1. If I run the browser on the same computer as the webserver, I see that
the cookies are sporadically not being sent from the browser for the .aspx
pages.
2. If I run the browser from a 2nd and 3rd computer and hit the web server
on the first computer, I see that the cookies are always being sent for the
.aspx pages.
3. If on the webserver I force asp.net to assume cookieless clients, my
browser on the same computer works fine since the "cookie" information is
part of the URL.

I haven't tried installing my dev environment on the 2nd or 3rd computers
and try to see how the browser behaves when hitting the new webserver. I am
trying to avoid that for now. But from my 1st computer, if I run the browser
against a totally different web application I have seen the same behavior in
my Fiddler logs. The browser sporadically does not send cookie information
to the server.

I suspect that it may be something specific to the IE browser on my
computer or a combination of it and the web application. Or maybe there is
some security program or setting that is causing this issue on this computer
and not others. Does anyone have any thoughts or ideas on what this problem
could be? I want to find out the problem to make sure that when I deploy my
web application, this issue does not resurface on my user's computers.

Thanks
Scherbina Vladimir
2006-01-18 09:25:54 UTC
Permalink
Post by junOnline
Hi, I am developing an asp.net 2.0 application using visual studio 2005 on my
computer and I am getting very inconsistent results when I test on my
computer versus from other computers.
The symptom of the problem is that the web server does not receive cookie
information from the browser after I have properly logged in to the web
server. Without this information, my session state keeps on getting lost and
the authentication logic sends me back out to the login page.
Using Fiddler, I have narrowed down the problem to what I think is the
browser not always sending cookie information (containing the session and
authentication ticket) to the web server.
1. If I run the browser on the same computer as the webserver, I see that
the cookies are sporadically not being sent from the browser for the .aspx
pages.
2. If I run the browser from a 2nd and 3rd computer and hit the web server
on the first computer, I see that the cookies are always being sent for the
.aspx pages.
3. If on the webserver I force asp.net to assume cookieless clients, my
browser on the same computer works fine since the "cookie" information is
part of the URL.
cookie is not part of the url, it is sent in Cookie header.
Post by junOnline
I haven't tried installing my dev environment on the 2nd or 3rd computers
and try to see how the browser behaves when hitting the new webserver. I am
trying to avoid that for now. But from my 1st computer, if I run the browser
against a totally different web application I have seen the same behavior in
my Fiddler logs. The browser sporadically does not send cookie information
to the server.
I suspect that it may be something specific to the IE browser on my
computer or a combination of it and the web application. Or maybe there is
some security program or setting that is causing this issue on this computer
and not others. Does anyone have any thoughts or ideas on what this problem
could be? I want to find out the problem to make sure that when I deploy my
web application, this issue does not resurface on my user's computers.
Thanks
Maybe the problem is in the security settings of your browser? If you're
using IE then play with security settings and notify us here about results.

--
Vladimir
junOnline
2006-01-19 19:20:02 UTC
Permalink
Thanks for the reply. I tried as you suggested and set the security to the
lowest possible value and it did not make any difference.

I went ahead and installed my dev environment on another machine and the
behavior I see in the first machine does not show up on the second one.

Going back to the first machine and reading the header information, this is
what I am seeing:

1. Request Default.aspx
Default.aspx Header: ASP.NET_sessionId cookie not there
.ASPXAUTH cookie not there
2. Server sends a redirect to Main/Login.aspx
Main/Login.aspx Header: ASP.NET_sessionId cookie not there
.ASPXAUTH cookie not there
3. User enters user name password and submits data to Main/Login.aspx
Main/Login.aspx Header: ASP.NET_sessionId cookie IS THERE
.ASPXAUTH cookie not there
4. Successful authentication redirect back to original Default.aspx
Default.aspx Header: ASP.NET_sessionId cookie not there
.ASPXAUTH cookie not there
5. Server sends a redirect to Main/Login.aspx due to lack of .ASPXAUTH
Main/Login.aspx Header: ASP.NET_sessionId cookie IS THERE
.ASPXAUTH cookie IS THERE
6. Server redirects back to original Default.aspx page because it is
autheticated
Default.aspx Header: ASP.NET_sessionId cookie not there
.ASPXAUTH cookie not there

Steps 5 and 6 are repeated a couple of times more until the Default.aspx
eventually sends both the ASP.NET and .ASPXAUTH cookies.

In a typical scenario, step 4 looks like this:
4. Successful authentication redirect back to original Default.aspx
Default.aspx Header: ASP.NET_sessionId cookie IS THERE
.ASPXAUTH cookie IS THERE

Any ideas as to what this may be? I read that someone else had a similar
problem and they resolved it by clearing their IE cache and cookies. I have
done that but the problem still occurs.

Thanks
Post by Scherbina Vladimir
Post by junOnline
Hi, I am developing an asp.net 2.0 application using visual studio 2005 on
my
Post by junOnline
computer and I am getting very inconsistent results when I test on my
computer versus from other computers.
The symptom of the problem is that the web server does not receive cookie
information from the browser after I have properly logged in to the web
server. Without this information, my session state keeps on getting lost
and
Post by junOnline
the authentication logic sends me back out to the login page.
Using Fiddler, I have narrowed down the problem to what I think is the
browser not always sending cookie information (containing the session and
authentication ticket) to the web server.
1. If I run the browser on the same computer as the webserver, I see that
the cookies are sporadically not being sent from the browser for the .aspx
pages.
2. If I run the browser from a 2nd and 3rd computer and hit the web server
on the first computer, I see that the cookies are always being sent for
the
Post by junOnline
.aspx pages.
3. If on the webserver I force asp.net to assume cookieless clients, my
browser on the same computer works fine since the "cookie" information is
part of the URL.
cookie is not part of the url, it is sent in Cookie header.
Post by junOnline
I haven't tried installing my dev environment on the 2nd or 3rd computers
and try to see how the browser behaves when hitting the new webserver. I
am
Post by junOnline
trying to avoid that for now. But from my 1st computer, if I run the
browser
Post by junOnline
against a totally different web application I have seen the same behavior
in
Post by junOnline
my Fiddler logs. The browser sporadically does not send cookie
information
Post by junOnline
to the server.
I suspect that it may be something specific to the IE browser on my
computer or a combination of it and the web application. Or maybe there is
some security program or setting that is causing this issue on this
computer
Post by junOnline
and not others. Does anyone have any thoughts or ideas on what this
problem
Post by junOnline
could be? I want to find out the problem to make sure that when I deploy
my
Post by junOnline
web application, this issue does not resurface on my user's computers.
Thanks
Maybe the problem is in the security settings of your browser? If you're
using IE then play with security settings and notify us here about results.
--
Vladimir
Scherbina Vladimir
2006-01-19 20:11:23 UTC
Permalink
When I need to check something concerning HTTP stuff I use IRIS sniffer,
it's very powerfull. Try to see what's going on 1st client using IRIS.

What browser do you use ? IE ? what version ? Do you use SP's ?
The problem of missing cookies might also appear because of some software
that filters your traffic (LSP's, Firewalls, etc). Check your 1st computer
software, how much it differes from other PC's ?

--
Vladimir

Loading...