问题
I have a REST Server
with an Android Client
, both on Deplhi Xe5
The android client succesfully connects with the Rest server.
In my server I have a TDSHttpWebDispatcher
with SessionTimeout
=1200000 (20 min)
So when the user in android doesn't use the app for more than 20 min, gets the "Session has expired" error when do a request to the REST server.
I already set the PresserveSessionId=False
in the DSRestConnection
in the Client app, so there is no sessiontimeout error, but it makes the app slower, because for every request to the REST server it creates a new session.
I wanna keep the PresserveSessionId=True
for better performance, and when the session expires (after 20 min) catch the "Session has expired" error and request for a new session for the client
How can i achieve that?
Thanks
Sorry for my english!, hope it is readable
回答1:
There is an open QC report on this here. The obvious work around would be to create a Try..Except
block on each call and on that specific exception request a new session.
来源:https://stackoverflow.com/questions/23796490/delphi-xe5-rest-android-client-session-has-expired