Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java 1.6: Setting persistant cookies

 
David Kafrissen
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic