Question: I would like the user to perform different tasks via HttpGet/HttpPost actions. 
I would like to save the Cookies so that the user only needs to login after expiration of the cookie. 

When traversing the internet I saw that the "PersistentCookiestore" is a good starting point. 

Question 1: how can I use the (apache) PersistentCookieStore in the HttpClient software? I don't see complete examples, e.g. how to start using the PersistentCookieStore in the first httpclient use. 

See for example: 

```
static PersistentCookieStore cookie_jar = new PersistentCookieStore( getApplicationContext()); 

public void login() { 
    // how to connect the persistent cookie store to the HttpClient? 
    ....
    client2 = new DefaultHttpClient( httpParameters);
    …
    client2.setCookieStore(cookie_jar);
    ....
    HttpGet method2 = new HttpGet(uri2);
    ....
    try {
     res = client2.execute(method2); 
}
catch ( ClientProtocolException e1) { e1.printStackTrace(); return false; }
    ....

```

Question 2: How can I update the cookie after a call, or is this never needed? 
In other words: When I have to update the cookie after a call to HttpGet or HttpPost after calling the client2.execute( ...). 

In the example code of (non-persistent) cookies with httpclient I saw: 

```
cookie_jar = client.getCookieStore(); 
….
HttpGet or HttpPost … 
client.setCookieStore( ....) 
client.execute( .. )  // second call

```

Thank you for helping.

Answer: 
Not a MySQL Person but here is a sql server general solution:

**DO** not do the update.

I do that on multiple occasions, **using triggers to maintain the count**. This has the advantage that this type of query is super fat because no updates must be done.
I would probably go with something like:

```
UPDATE collections C INNER JOIN (SELECT  CU.collection_id, 
    count(*) cu_count
FROM collections_users CU) cu2 ON C.id = cu2.collection_id
SET C.follower_count_summary =  cu2.cu_count;

```

However I'm not in front of MySQL at the moment and can't double check this with EXPLAIN....so it's a guess

cheers