If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

accessing localstorage using javascript

I have a requirement where when the user is working on a screen, before the session logs off it saves a message in local storage:

var userid = self.document.Form1.gsAftlnr.value;
/* saves the userid in the above variable */
localStorage.setItem(userid, 'Your previous work was saved in Drafts in the Post Centre.');
parent.logo.logoff();

Suppose if the userid = 749461, with this above storage, I am expecting the localstorage the store the string data under key name 749461. Correct me if I am wrong.

When the user logs in again, I am executing the following code:
if(localStorage.getItem(userid) !== null)
{ alert(localStorage.getItem(userid)); }
I want this alert to show up only when the same user logs in again, which is 749461 in this case. But this alert is popping up for other users also.