0

I'm creating a web app for an iphone using ruby on rails 3.

If I add the app to my iphone home screen, everytime I launch the app, I need to login again.
I also just realized that when I close the browser on my PC and reopen it, I lose the session as well.

Is there a way to prevent that?

Ultimately, I'm trying to prevent the need to login everytime a user launches the web app from the 'home screen'; e.g. instead make it every 7 days or so.

4

2 回答 2

0

是的,不是将登录信息存储在 $_SESSION 变量中,而是将其存储在 $_COOKIE 中。cookie 将根据您将其设置为过期时间(在您的示例中为 7 天)来保存。只要他们“在”网络应用程序或常规网络版本(cookie 相同)“内部”登录,他们就不必每次或在两者之间切换时都登录。

于 2012-03-10T02:35:16.963 回答
0

尝试使用 HTML5 本地网络存储

于 2012-03-09T11:46:10.253 回答