0

how can I know mobile web browser & app close? I using local Storage for make auto login in my mobile Web. when I set auto login function is false and than close mobile web browser in my iphone and restart browser. It's still login true in local storage. I don't know exactly how can I know mobile web browser close.

just upload my code like this

autoLogin button check -> localStorage.autoLogin = "true" 

autoLogin button not check -> localStorage.autoLogin = "false"
Omar
  • 32,302
  • 9
  • 69
  • 112
jay kim
  • 77
  • 2
  • 5
  • there isn't an event for that. – Daniel A. White Aug 04 '18 at 12:16
  • You'd be looking for the `onbeforeunload` event, but it is [not supported on some mobile devices](https://stackoverflow.com/questions/6903457/is-the-onbeforeunload-event-not-supported-on-iphone) (and desktop browsers that do support it will limit what you're allowed to do in that event handler, due to too many bad actors abusing it to force windows to stay open or cause other annoyances.) – Daniel Beck Aug 04 '18 at 17:37

0 Answers0