Sencha-touch:保存登录/密码(保存会话,多任务) [英] Sencha-touch : save login / password (save session, multi-tasks)
问题描述
可以用sencha-touch吗?
场景:
在iPhone中,有一个图标来启动sencha touch应用程序,她问登录/密码通过提示对话框。我输入登录/密码,我咨询内容。我靠近home iphone button。我重新启动应用程序,她再次询问登录/密码!!!
没有会话?
否多任务功能与sencha-touch?
我想你已经在某处使用webservice来存储/检查用户名/密码组合。当登录成功时,您应该在服务器上创建会话令牌并将其返回到您的应用程序。
您的应用程序应将该令牌存储在本地存储器中,连同您的用户名和密码,并且每当您对Web服务进行任何请求时,都应发送您的令牌以进行验证。
当您第二次打开应用程序时,如果会话存活,您可以继续使用令牌。如果服务器上的会话已经结束,并且服务器向您的应用程序返回令牌错误,则应将您的logininfo重新发送到webservice以创建新的令牌。
I have a java web application with mobile part developed with Sencha touch. When I launch my sencha touch application, she asks my login/password because the access of the application is restricted, but I want to save login/password for the user. Is it possible with sencha-touch?
Scenario: In a iPhone, there is an icon to launch the sencha touch application, she's asks the login/password by a prompt dialog. I entered login/password, I consult the content. I close by the 'home iphone button'. I relaunch the application, she's ask again login/password!!!
There is no session? No multi-tasks functionnality with sencha-touch?
I guess you already use a webservice somewhere to store/check the username/password combinations. When a login is successfull, you should create a Session Token on the server and return that to your app. Your app should store the token in the localstorage, together with your username and password and whenever you make any requests to your webservice, you should send your token along for validation. When you open your app for the second time, if the session is alive you can continue using the token. If the session on the server has ended and the server returns a token error to your app, you should resend your logininfo to the webservice to create a new token.
这篇关于Sencha-touch:保存登录/密码(保存会话,多任务)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!