Question

How to handle cookie or data storage in tizen sdk with javascript. I'm looking for options to store my session details and the authentication details to validate, in all other pages.

My Scenario is I'm having an html/javascript application which will contact java servlet through AJAX for all the authentication and search functionality. In all the service calls i'm checking the session and the cookie to validate the login status of the user. First page "index.html" holds the login screen and navigate to another html page present in /WebContent folder on successful authentication. I couldn't able to access any information (Session/Cookie) in the second page which is stored through first page.

I'm looking for accessing these values in second page or anyother way to pass values between pages of an app

Était-ce utile?

La solution

Javascript and HTML now offers the use of localStorages to keep name value pair data:

// to store a value
window.localStorage.setItem( 'item_name', item_value);

// to retrieve a value
item_value = window.localStorage.getItem( 'item_name' );

// to delete a storage
window.localStorage.removeItem( 'item_name' );

Hope that helps.

Autres conseils

If you create a Web App Widget you should use Filesystem API provide by Tizen API to store data.

If you look in Remote inspector help at Resources Panel it says:

The Resources panel allows you to inspect resources. You can interact with frames containing resources, such as HTML, JavaScript, CSS, images, and fonts. Additionally, you can also inspect HTML5 databases, local storage, cookies, and application cache.

So you can also use one of this to store your data.

You can use jQuery in your Web App and cookies, see here in this answer a plugin:
cookies with jQuery

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top