-5

Is it possible in javascript to retain the value of a variable not just in one browser but in a different browser? I tried localStorage and sessionStorage but it only works on the current browser only.

Can I have a sample code on how to achieve that?

Thank you.

Jeff
  • 21
  • 4
  • 1
    `not just in one browser but in a different browser` - think about this ... so, I have a different browser, so do i get to see the value too? – Jaromanda X Aug 10 '23 at 06:57

1 Answers1

1

Generally speaking, no - it cannot be done. If it were possible, it be a huge security risk. In your case, data should be saved on a backend server or some kind of online storage. That is the only way to do so.

Also, dont ask for sample code on stackoverflow. SO is more of a "knowledge database" - asking for specific problems and finding optimal solutions, rather than just providing "sample code".

Patrick Cerny
  • 191
  • 2
  • 8