简体   繁体   English

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

[英]How do I keep a logged-in session active from within my standalone iOS web application?

My web app requires a log-in, which points to a single page, then populates using ajax calls. 我的Web应用程序需要登录,该登录指向单个页面,然后使用ajax调用进行填充。 I have a timeout set for 12 hours for the active SESSION...which works great from within the browser. 我为活动的SESSION设置了12小时的超时时间...在浏览器中效果很好。 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. 现在,我已经将其配置为“独立”,这要求用户每次离开应用程序时都进行登录……这显然很痛苦。

I thought I found the answer with Cache Manifest, but can't seem to get it working. 我以为我已找到Cache Manifest的答案,但似乎无法正常工作。 Is there another approach, or something I'm missing? 还有其他方法,还是我缺少的东西?

Thanks! 谢谢!

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以保护用户,但这应该可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM