I have been working on a section where particular actions took/take place based on if certain Cookies existed or not. After a lot of hassle, and with a lot of help,especially from @m_hutley, I got that working. During this process a number of people pointed out that I could better use localStorage instead of Cookies for these kinds of actions. I did take notice of that, but I wanted it to have it working first. So today I have been reading a number of articles about the advantages and disadvantages of using localStorage over Cookies and I am convinced And I now have what was working with Cookies, working with localStorage as well. There is only a supplement that I would like to have and I can not figure out how to do that.
At the moment I only check if an item is set in the following way:
if (localStorage.getItem("mailinglist_popup") === null) $('#myModall').modal('show') localStorage.setItem("mailinglist_popup", "seen");
So if item mailinglist_popup doesn’t exist show the modal and set the item. What I would like to have as an adjustmet though is a check to show the modal again after a certain amount of time (2 months) has expired but I can’t get my head arrount it.
I would be very thankful for any advise