如何在我的独立iOS Web应用程序中保持登录会话的活动状态?

时间:2023-01-13 21:10:16

My web app requires a log-in, which points to a single page, then populates using ajax calls. I have a timeout set for 12 hours for the active SESSION...which works great from within the browser. Now that I've configured it for 'standalone', however, it's requiring users to sign in each time they leave the app...which is an obvious pain.

我的网络应用程序需要登录,指向单个页面,然后使用ajax调用填充。我为活动的SESSION设置了12小时的超时...这在浏览器中运行良好。现在我已将其配置为“独立”,但是,它要求用户每次离开应用程序时都要登录...这显然很痛苦。

I thought I found the answer with Cache Manifest, but can't seem to get it working. Is there another approach, or something I'm missing?

我以为我找到了Cache Manifest的答案,但似乎无法让它运行起来。还有其他方法,或者我缺少的东西?

Thanks!

1 个解决方案

#1


0  

I have no expertise on it, but what about reusing the session id, save them to the database and if the user comes back, the session is restarted and the data pulled from the database?

我没有相关的专业知识,但是如何重用会话ID,将它们保存到数据库中,如果用户回来,会话重新启动并从数据库中提取数据?

You should use https with the session and consider to renew the session id after a while to protect the user, but this should work.

您应该在会话中使用https并考虑在一段时间后更新会话ID以保护用户,但这应该有效。

#1


0  

I have no expertise on it, but what about reusing the session id, save them to the database and if the user comes back, the session is restarted and the data pulled from the database?

我没有相关的专业知识,但是如何重用会话ID,将它们保存到数据库中,如果用户回来,会话重新启动并从数据库中提取数据?

You should use https with the session and consider to renew the session id after a while to protect the user, but this should work.

您应该在会话中使用https并考虑在一段时间后更新会话ID以保护用户,但这应该有效。