Java applet delete browsesr cookies


I have java applet in my website. Sometimes I noticed that after my java applet is loaded - the client loses his cookies. it seamed that the Java applet deleting the cookies....

I am using MindTerm Java applet. Their support said that they not delete the browser cookies in their code.

This scenario disconnect the user from my website.
This problem only occur on Internet Explorer 6.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi there;

so we are sure?

If you block the use of cookies on the web in general you need to allow it for your website:

Allow cookies in Internet Explorer:

1.      Tools [menu]
2.      Internet Options& [submenu]
3.      Privacy [tab]
4.      Sites& [button]
5.      Type "" and press Allow [button]
6.      OK until all dialog windows are closed

Allow JavaScript and Java in Internet Explorer:

1.      Tools [menu]
2.      Internet Options& [submenu]
3.      Security [tab]
4.      Internet [Web content zone]
5.      Custom Level& [button]
6.      Under section called "Scripting"
    a.      "Active scripting" set to Enable
    b.      "Scripting of Java applets" set to Enable
7.      Ok until all dialog windows are closed

Best regards...
Cyber-EEAuthor Commented:
All of the configurations are enabled.

The problem still occur....
The following link may help

if you wanted to do by code then have a look at bellow snippet


       **  delete a cookie, set the expiration in the past
       java.util.Calendar c = java.util.Calendar.getInstance();
       c.add(java.util.Calendar.MONTH, -1);
       String expires = "; expires=" + c.getTime().toString();
       JSObject myBrowser = JSObject.getWindow(this);
       JSObject myDocument =  (JSObject) myBrowser.getMember("document");
       myDocument.setMember("cookie", expires);

Open in new window

Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

Cyber-EEAuthor Commented:
How is suppose to help me?

I don't want to delete the browser cookie.
I sure that the java applet isn't deleting any cookie.
oops, sorry for that, how about this one
In IE 6, from the Tools menu, select Internet options. Click on the Privacy tab. Then click on the Advanced button
1. Check the Override automatic cookie handling box.
2. Click on the Accept radio buttons for First-party cookies and Third-party Cookies.
3. Check the Always allow session cookies box
4. Click OK twice
now try with your website and let me know if it works
Cyber-EEAuthor Commented:
I already do that...

Still not working....
Cyber-EEAuthor Commented:
Problem solved!!!!

My web application is written in

My cookies defined as HttpOnly Mode.
cookie.HttpOnly = true;

This option disable the document.cookie access in client side under internet explorer.
I removed the HttpOnly limitation from my cookies and suddenly the java applet is working fine.

I don't know why IE6 is deleting the web application's cookies.

All the browsers including IE7 support this HttpOnly feature.

Haapy happy
Joy Joy

thanks you all....
Congratulation Cyber-EE,
                                    Today I add one more tip to my secret knowledge base, thank you for sharing it.
Happy programming,
Really happy for you and i appreciate your effort...
Question PAQ'd, 500 points refunded, and stored in the solution database.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.