File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Can't block cookies in IE 6.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Can Watch "Can New topic
Author

Can't block cookies in IE 6.0

Vartan Nazarian
Greenhorn

Joined: Jan 26, 2004
Posts: 6
Hi,

I'm experimenting with cookies on IE 6.0 and Firefox. AppServer is Jboss 4.0 on the localhost.

I start with page1.jsp:
<%
Float pi = new Float(3.14);
session.setAttribute("pi",pi);
%>
<a href = "page2.jsp">page2.jsp</a>

page2.jsp:
<%
Float f = (Float)session.getAttribute("pi");
if(f == null)
out.println("Session is dead");
else
out.println("pi is: " + f.floatValue());
%>

For both IE and Firefox I block the cookies and this is what I get:
1- session survives in IE (bad, very bad) and the output is "pi is: 3.14"
2- session dies in Firefox (excellent) and output is "Session is dead"

First of all what else do I need to do in IE to block cookies?
Secondly where on my hard drive are Firefox cookes saved?

Thanks guys.

Vartan
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

MSIE has a separate section for 'session' cookies.
I don't remember where exactly it is.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
osman cinar eren
Ranch Hand

Joined: Jan 25, 2005
Posts: 78
in internet options;

in the third tab from left(i use a turkish browser so i cannot tell what i writes )
in the advanced button on the top frame.(there are two frames)

you can set the cookie options here.

regards.


SCJP/SCWCD
Vartan Nazarian
Greenhorn

Joined: Jan 26, 2004
Posts: 6
The problem is not how to block the cookies in IE that's straight forward.
The problem is that after you block the cookies in "Privacy" tab the session tracking is still on.

After I block the cookies in "Advanced Privacy Settings" window and run my example it still tracks the session, but it shouldn't. When I go from page1.jsp to page2.jsp it should NOT know who I am since the cookie is blocked.

BTW Firefox works fine, as soon as I block the cookie session tracking stops.

Try the example on IE and block the cookies, even with cookies blocked you will be able to track the session.

Vartan
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

In the "Advanced Privacy" section of Internet Options, do you have "Always allow session cookies" checked off?
Vartan Nazarian
Greenhorn

Joined: Jan 26, 2004
Posts: 6
No "Always allow session cookies" is unchecked. In the Advanced Privacy Settings I've only checked "Override automatic cookie handling" and then selected the "block" choice under both First-party and Third-party cookies.

I'm running my example on Jboss on my machine so if I add localhost as a restriced site in the security tab then session tracking stops.

Thanks for your interest and time.

Vartan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't block cookies in IE 6.0
 
Similar Threads
Hi, encodeURL question...
whilst fooling around with SessionId and cookies...
Session management ambiguity
URL rewriting