aspose file tools*
The moose likes Applets and the fly likes Java 1.6: Setting persistant cookies Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Java 1.6: Setting persistant cookies" Watch "Java 1.6: Setting persistant cookies" New topic
Author

Java 1.6: Setting persistant cookies

David Kafrissen
Greenhorn

Joined: May 04, 2004
Posts: 10
Greetings,

We are trying to set persistant cookies. Can this be done? If we close the browser and come back the cookies are not there.

We are using the java plugin default cookie handler.

The web server is embedded so we can not script from there.

What we want is a remember me button on the applet which just supresses the login box on subsequent runs.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42913
    
  68
I don't think any cookies set with the Java plugin can be made persistent, but you can use the getStream/setStream methods of AppletContext to store little pieces of information locally. That should work just as well here.
David Kafrissen
Greenhorn

Joined: May 04, 2004
Posts: 10
thanks, this seems perfect, I actually do not care how the data is stored. And I am only storing a small bit of data.

Are there any docs that describe were this data goes?

Just curious, the javadoc on the api does not list where the data actually goes.
David Kafrissen
Greenhorn

Joined: May 04, 2004
Posts: 10
This does not seem to work.

While the browser is running, we can save and retrieve info.

However, once the browser closes, the data goes away.

Our goal is to have a "remember me" box when the user logs into the applet.

Our applet controls an embedded device.

There is only one main login, the goal is since this device is on the local network, only people who know the password, who have read the manual, can get in to the applet to control the device.

Once someone has logged in once to the applet, we are assuming that the same person would be logging in on "that" computer so that once they have logged in, they should be able to hit remember me.

We want the remember me only for that computer, not every computer on the local area network.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java 1.6: Setting persistant cookies