android 我们可以在应用程序中进行 session 管理和超时吗

标签 android

你好 friend 们,,,

我正在开发一个应用程序 XYZ,它在服务器端保持 session 超时..

实际上,在登录服务时,我会收到一个 session token ,该 token 用于访问更多 Web 服务,并且该 token 会在一定时间(比如 30 分钟)后过期...

由于使用的不同 Web 服务未显示所需的响应,因此 token 会过期。

是否有任何 Android 指定方法来维护完整应用程序的超时,以便能够在超时( session token 过期)后在登录时自动重定向。

如果没有,请提供两种方式(与 Apache HttpClient 相关,我用于 HTTP 访问的库。)

很想知道任何特定于 android 的方法来做到这一点..

问候,

阿皮特

最佳答案

Is there any Android specify way to maintain timeout for complete application for being able to automatically redirected at login after timeout(session token expired).

使用代表您的 token 及其验证时间的静态数据成员。检查每个 Activity 的 onResume() 中的 token 。如果 token 丢失或过期,将用户重定向到登录 Activity 。

关于android 我们可以在应用程序中进行 session 管理和超时吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6706245/

相关文章:

android - Spring RestTemplate I/O 错误 : No peer certificate

android - 错误 : "The graphics preview in the layout editor may not be accurate: Paint.setShadowLayer is not supported"

android - 在 gridview 末尾添加一个 textview 用于加载更多图片

android - 按下时可滚动的 TextView 黑色?

android - 如何知道ListView的最后一行是否显示完整?

android - 在同一 FrameLayout 中添加多个 fragment

java - Android ListView 只显示最新的项目

android - 你如何在Android上记录一个int?

c# - 正在将 Xamarin.Forms 更新到 2.5...与其他包冲突

android - 将文件写入 getFilesDir() 失败 - NoSuchElementException