Session Variables

Hi,

is there a recommended way to store session variables for passing between pages in an offline rhoelements application?

I need a way for a user to log in, and then I will have to pass the userID and two or three session variables between pages as the user navigates through the application. It seems like it might be possible to do it with cookies, a state file, a database or the registry - is any one method preferred?

Thanks,

Ord

Robert Galvin
Hi Ord You should be using

Hi Ord

You should be using the HTML5 Localstorage feature.

//Save a value to localStorage

localStorage.setItem('key', 'value to save');

//OR

localStorage.key = 'string value to save';

//Get the value back out of localStorage

localStorage.getItem('key');

//OR

localStorage.key;

//Clear all localStorage values

localStorage.clear();

This data will persist until the application clears it (unlike Session variables that only last the session)

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ord Millar
Thanks Rob!

Thanks Rob!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments