Answer the question
In order to leave comments, you need to log in
Retrofit, do I need to use expire/max-age?
Good afternoon, there is a rest service, I use Retofit to work with it, when I log in, I get a cookie in response.
then I use this cookie to get information from the service.
I get it like this:
String cookie = service.atuhorize(...).execute().raw().header("Set-Cookie");
JSESSIONID=<тут куча букв>; path=/iapp; Max-Age=31536000; Expires=Thu, 22-Sep-2016 10:04:15 GMT
@Headers({"Content-Type: application/json"})
@GET("iapp/getCurrentUser")
Call<Profile> getCurrentUser(@Header("Set-Cookie") String cookieA);
Answer the question
In order to leave comments, you need to log in
Only JSESSIONID (exactly that bunch of characters) is enough,
max-age seems to indicate the lifespan of cookies on the server side, but Expires, apparently, is the date the session was created.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question