Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to save data for a particular userid

    Hello,

    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.

    My code:
    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.');
    parent.logo.logoff();
    }

    When the user logs in again:
    if(localStorage.getItem(1) !== null)
    { alert(localStorage.getItem(1));
    localStorage.clear()
    }

    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.

    I can use only HTML and JAVASCRIPT. Not JavaQuery also.

    Thanks in advance.

  • #2
    New Coder djpaul1963's Avatar
    Join Date
    Apr 2012
    Location
    Athens GR
    Posts
    74
    Thanks
    0
    Thanked 8 Times in 8 Posts
    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.

  • #3
    New Coder djpaul1963's Avatar
    Join Date
    Apr 2012
    Location
    Athens GR
    Posts
    74
    Thanks
    0
    Thanked 8 Times in 8 Posts
    Reading your post again however, I realized that you probably should ask your question to the javascript section and not flash & actionscript
    Everything can be done, but I don't know how.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •