views:

226

answers:

1

I have a java applet that needs to do http requests to the server. A quick experiment showed that the session id cookies from the browser is not sent along, so i'll have to set it manually. Currently, I see 2 possible solutions:

  • somehow get hold of the cookie data from within the applet
  • pass the cookie information into the applet's contructor via javascript

I'd prefer the first solution, but i wasn't able to find a working solution for that. all information i found (mostly netscape.javascript.JSObject) were outdated (my 1.5 VM does not have this class)

Any great ideas or resources i have not yet found?

+3  A: 

Are you sure your JVM doesn't contain this class? You should look in $JAVA_HOME/lib/plugin.jar. I found it in my 1.5.0_14 installation.

If you are generating the page dynamically, you don't necessarily need to use JavaScript to communicate the session ID. As long as you know it server-side, you can place it into an applet parameter tag in the generated HTML which contains the <applet> tag.

Vinay Sajip
errrrr..... whoops.there it is...okay thank you very much
Michael Siebert