First of all, thanks a lot for your answer Federico!
My server seems to always accept the same cookie, I'm not sure, but
for now, we can guess it !
So I think I'll try to serialize & store the cookie before the
activity is killed, and restore it when restart.
I'll send a message after this work is done.
Louis C.

On Jan 13, 3:44 pm, Federico Paolinelli <[email protected]> wrote:
> I am afraid you have to implement a recovery mechanism in any case,
> because of cookies expiration. If the server gives you an
> authentication error you should restart the authentication process
> before performing any other action.
>
> In any case you can serialize and store the cookie in the shared
> preferences storage or in a file or wherever you want, and build a new
> cookie out of the saved data when your applicatoin is restarted. It
> should work _unless_ the cookie is expired.
>
> Hope this helps,
>
>     Federico
>
> On 13 Gen, 11:48, lou <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hi !
> > I have an application using HttpClient, who saves automatically the
> > cookies received from the login request.
> > The matter : when an activity is killed, my httpClient is reseted,
> > consequently all next request are refused by the server cause the
> > cookies aren't sent.
> > What can I do ?
>
> > My suggestion : save the HttpClient in onSaveInstanceState(Bundle
> > outState), but I think it isn't possible
> > My other suggestion : get cookies ( I don't know how ! ) and save it
> > in onSaveInstancestate(...), and restore it in onRestoreInstanceState
>
> > Maybe these suggestions aren't the good solution. In all case, I need
> > a little bit of your help !
> > Thanks in advance.
> > Louis C.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to