0

Background

I'm using session storage in an application I'm writing. I know that sometimes its not supported in very old browsers. In addition I guess there could be browser settings or extensions that can mess with session storage. As in stop something from being retrieved or saved etc. & crash the app.

Question

Can these outlying scenarios crash my app? And is it best to wrap a getSessionStorage in a try catch to gracefully fail?

Joe Lloyd
  • 19,471
  • 7
  • 53
  • 81
  • 1
    You are talking like IE7..... seems a bit old to worry about lack of support. – epascarello Oct 26 '21 at 18:08
  • Good old [modernizr](https://modernizr.com/) days :) – swapnesh Oct 26 '21 at 18:10
  • thanks @epascarello, so this is not worth adding I gather. Thank you for the input, its been awhile since i wrote some session storage stuff. – Joe Lloyd Oct 26 '21 at 18:15
  • 1
    [This answer](https://stackoverflow.com/a/49323105/1048572) lists two cases where a regular (i.e. not modified by an extension etc) storage throws exceptions. Yes, you better catch those. – Bergi Oct 26 '21 at 18:19

0 Answers0