IE DOES NOT SUPPORT COOKIE on WIN2K and XP

K

krisrajz

Please observe the pages below:

session1.asp

<%
Session("test")="TESTING"
Response.Redirect "session2.asp"
%>

session2.asp

<%
Response.Write Session("test")
%>

Those pages does not output any thing if I use IE and If I access the pages
from machines running Windows 2000 Server, XP or Windows NT Server. Opera
outputs as per session variables name.

IIS server is running Windows 2000 server. I've checked the cookie settings
which was set to accept cookies.

I tried IE 5.0, IE 5.5 and IE 6.0

What could be the fix?
 
B

Bob Barrows [MVP]

krisrajz said:
Please observe the pages below:

session1.asp

<%
Session("test")="TESTING"
Response.Redirect "session2.asp"
%>

session2.asp

<%
Response.Write Session("test")
%>

Those pages does not output any thing if I use IE and If I access the
pages from machines running Windows 2000 Server, XP or Windows NT
Server. Opera outputs as per session variables name.

IIS server is running Windows 2000 server. I've checked the cookie
settings which was set to accept cookies.

I tried IE 5.0, IE 5.5 and IE 6.0

The only way a browser can affect the ability to use sessions is by
allowing/disallowing cookies.

Bob Barrows
 
D

Dave Anderson

Bob said:
The only way a browser can affect the ability to use sessions is by
allowing/disallowing cookies.

Within the same window, perhaps that is true. But Internet Explorer goes the
extra mile with the ability to prevent separate windows (or frames) from
sharing cookies with each other. And in a manner that's uncontrollable, no
less. Bravo, Microsoft!


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
K

krisrajz

What's wrong with IE? or Do I need to disregard IE and to opt for other
browsers?

Is there any other programmable browsers available like IE?

RAJ.
 
K

krisrajz

Please observe the code snippet

Shot #1

sample1.asp

<%
Session("test")="Session Testing"
Response.Cookies("cookietest")="Cookie Testing"
Response.write Session("test")
Response.Write Response.Cookies("cookietest")
%>

Does outputs Session Testing and Cookie Testing where as shot #2 does output
anything:

Shot #2

sample1.asp

<%
Session("test")="Session Testing"
Response.Cookies("cookietest")="Cookie Testing"
Response.Redirect "sample2.asp"
%>

sample2.asp

<%
Response.Write Session("test")
Response.Write Response.Cookies("cookietest")
%>

I've tested those pages on Avant Browser ( which is also IE based), it too
behaves as IE does. When I test pages on Opera, Netscape Navigator the pages
does output.

Why do IE behaves strangely on handling cookies and sessions? or Does IE
really has the ability to handle sessions efficiently?

Is there any patches available to fix the issue?

Any great workaround would be very much useful and appreciated.

TIA
RAJ.
 
B

Bob Barrows [MVP]

krisrajz said:
Please observe the code snippet

Shot #1

sample1.asp

<%
Session("test")="Session Testing"
Response.Cookies("cookietest")="Cookie Testing"
Response.write Session("test")
Response.Write Response.Cookies("cookietest")
%>

Does outputs Session Testing and Cookie Testing where as shot #2 does
output anything:

Shot #2

sample1.asp

<%
Session("test")="Session Testing"
Response.Cookies("cookietest")="Cookie Testing"
Response.Redirect "sample2.asp"
%>

sample2.asp

<%
Response.Write Session("test")
Response.Write Response.Cookies("cookietest")
%>

I've tested those pages on Avant Browser ( which is also IE based),
it too behaves as IE does. When I test pages on Opera, Netscape
Navigator the pages does output.


I tested your code on my machine and discovered that the Redirect was the
problem. I changed the code to this:

<%
Session("test")="Session Testing"
Response.Cookies("cookietest")="Cookie Testing"
Response.Redirect "Sample2.asp?SessID=" & session.SessionID
%>

<%
Response.Write Session.SessionID & "<BR>"
Response.Write Session("test") & "<BR>"
Response.Write Request.Cookies("cookietest")
%>


And discovered that Redirect was causing a new session to be initiated. I
don't remember this behavior occurring so a recent service pack must be
responsible.

When I changed "Response.Redirect" to "Server.Transfer", the Session and
Cookie variable values were retained.

Bob Barrows
 
K

krisrajz

Indeed, tons of thanx.

I've got installed SP4 on my machine which version of SP would fix my error.

TIA
RAJ.
 
B

Bob Barrows [MVP]

You don't understand. Recent SP's for IE have been tightening security. I do
not believe that a SP will be released to reverse this change.

Bob Barrows
 
D

Dave Anderson

krisrajz said:
What's wrong with IE?

[...Must...resist...temptation...]

Regarding this specific issue, one thing is wrong with Internet Explorer. IE
attempts to guess when it should share sessions between browser windows. The
problem isn't that IE has this ability. The problem is that the user (and
consequently the developer) has no control over it.


...Do I need to disregard IE and to opt for other browsers?

That's a virtual impossibility, isn't it? All recent estimates I've seen put
IE saturation between 80% and 89% of the UA population. Rather than
disregard IE, you will have to learn to embrace what it *can* do, and pine
for what it *could* do (e.g. CSS attribute selectors).



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top