loading...

re: Please Stop Using Local Storage VIEW POST

FULL DISCUSSION
 

I almost used localStorage my every project. For example:

let OrderID = document.querySelector(".orderNum").innerText;
window.localStorage.setItem("OrderID", OrderID);

After that, I redirect another page without any query string. I still need to OrderID. This is the best solution at the moment.

I did not store any important information in localStorage. Yes, I know we shouldn't store any password or related information in localStorage.

What about OrderID like information? Should I use? I don't want to use server-side sessions.

For example, I completed Order. I delete key from localStorage.

window.localStorage.removeItem("OrderID");

Thanks for this great article.

 
 

After that, I redirect another page without any query string. I still need to OrderID. What about OrderID like information? Should I use? I don't want to use server-side sessions.

You've just discovered POST.

code of conduct - report abuse