[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Java applet delete browsesr cookies

Posted on 2008-11-05
11
Medium Priority
?
1,081 Views
Last Modified: 2013-11-24
Hello.

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.


0
Comment
Question by:Cyber-EE
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 12

Expert Comment

by:jazzIIIlove
ID: 22883863
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 "www.yoursite.com" 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...
0
 

Author Comment

by:Cyber-EE
ID: 22884158
All of the configurations are enabled.

The problem still occur....
0
 
LVL 3

Expert Comment

by:samalraj
ID: 22884364
The following link may help
http://www.java.com/en/download/help/5000020300.xml

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

Regards,
amalraj

 /*
       **  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

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Cyber-EE
ID: 22884423
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.
0
 
LVL 3

Expert Comment

by:samalraj
ID: 22884502
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
0
 

Author Comment

by:Cyber-EE
ID: 22884642
I already do that...

Still not working....
0
 

Author Comment

by:Cyber-EE
ID: 22884953
Problem solved!!!!

My web application is written in asp.net.

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
Erez!

thanks you all....
0
 
LVL 3

Expert Comment

by:samalraj
ID: 22885026
Congratulation Cyber-EE,
                                    Today I add one more tip to my secret knowledge base, thank you for sharing it.
Happy programming,
:)
0
 
LVL 12

Expert Comment

by:jazzIIIlove
ID: 22887554
Really happy for you and i appreciate your effort...
0
 

Accepted Solution

by:
ee_auto earned 0 total points
ID: 24017130
Question PAQ'd, 500 points refunded, and stored in the solution database.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses
Course of the Month20 days, 10 hours left to enroll

868 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question