2

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?

1
  • I wouldn't recommend client-side authentication, it's easy to get around. Commented Jun 14, 2011 at 18:56

2 Answers 2

6

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.

Sign up to request clarification or add additional context in comments.

Comments

0

You can embed your Sencha Touch code into a UIWebView: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html

This will allow your applcation to save state (i.e. not reload) if you exit and return to your application.

1 Comment

This solution is only for iOS? I need a solution for mobile supported sencha-touch: iOS, Android 2+, BlackBerry 6+.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.