I was wondering if there was a standard way for backbone models/controllers to handle sessions ending. I am using node.js as the backend for my webapp, and for now am storing sessions in memory. This means that if the server is restarted session information will be lost. If the session information is lost then a call to the server to save a model might fail due to not having a user. If this happens, I’d like to pop up a login prompt or something. Is there a standard way to catch sessions ending from within a backbone model?
Thanks
I think your server should respond with a concrete error code like 401 and in the client layer respond to this kind of error code in a common behavior: like showing the login page you said.
You can capture this error code at a jQuery level.