Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
05-31-2013, 10:41 AM #1
- Join Date
- May 2013
- Thanked 0 Times in 0 Posts
How to save data for a particular userid
I have a requirement where I want to save a message for a particular userid, if the session he was working on automatically logged off. So that next time when he logs in, the message will pop up saying his previous work was saved in drafts.
I tried using localStorage, but data stored in this manner is not available in other desktops plus it shows this message when I login thru some other user id also.
if (idleTime == 30) /* Auto logoff after 30 min of idle time */
localStorage.setItem(1, 'Your previous work was saved in Drafts in the Post Centre.');
When the user logs in again:
if(localStorage.getItem(1) !== null)
I want to save this message for this particular userid and when he logs in again from any desktop and want this message to be available.
Thanks in advance.
06-01-2013, 10:50 AM #2
I am not sure if your code above uses SharedObject class or not, especially because your code refers to setItem() and getItem() methods that are not members of that class. If not, try to implement SharedObject. It can store vaues per user according to documentation (http://help.adobe.com/en_US/FlashPla...redObject.html).
However I am not sure what you mean by 'another desktop'. A different login on the same windows or a different computer? If the latter is your case, the use of a remote server is inevitable. For this approach you can use a big number of client/server solutions, most simple and easy to implement imo is to call a web page (php/asp whatever you are familiar with) and pass the data you want to store as url variables. When you want them back, you ask that same page to deliver them to you again.
06-01-2013, 11:14 AM #3
Everything can be done, but I don't know how.