Try using Singleton. The thing is that when you create Class and only one object of this class can exist. And you can get this object from anywhere just calling CookieStore.getInstance()
(thats how i called this class)
It would be smth like this :
class CookieStore {
private CookieStore(){}
private static CookieStore instance;
private List<Cookie> cookies;
public static CookieStore getInstance() {
if (instance == null) {
instance = new CookieStore();
}
return instance;
}
public List<Cookie> getCookies()...
public void setCookies(final List<Cookie> cookies)...
}