|
Cookie Handling in Java
An Introduction |
|
Prof. David Bernstein
|
| Computer Science Department |
| bernstdh@jmu.edu |
Cookie headerSet-Cookie header
CookieHandler
Interface:
get() gets all applicable cookies from the cache
put() sets all applicable cookiesset() is a static method that sets the universal
cookie handler for all subsequent HTTP connectionsCookieManager
Class:
CookieStore to save/retrieve the cookies
CookieStore
Interface:
CookieStore
(and probably Runnable for reasons discussed below)
Runtime.getRuntime().addShutdownHook()
and pass it a Thread (with an associated
Runnable)