Delphi XE5 REST/Android Client “Session has expired”

妖精的绣舞 提交于 2020-01-24 18:03:37

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!