I'm writing a JavaScript game using HTML5 localStorage to save games between sessions. I want to warn the player if their browser is not currently set up to persist localStorage between sessions, for one reason or another. Two situations I can think of are private browsing or incognito mode, and if they have cookies disabled. There might be other reasons I haven't thought of. How can I know whether to pop up the warning?
I'm not worried about users explicitly clearing their localStorage, that's fine. I'm only concerned about users who are failing to actually save their games without realizing it.