I was hoping to pick people's brains on a topic. I am developing a web app which sits on top of Expression Engine and this has worked really well so far.
I have one issue though and I have a quick solution but I was hoping to find a more elegant approach, perhaps using hooks or something of that nature.
Basically, our application is very heavily ajax-driven and as such our users can do quite a lot without ever really leaving the page. However, they need to be logged in to do this properly. So you can imagine a scenario whereby a user walks away from their computer for an extended period, comes back, sees the application still running and then attempts to work with it but finds that they either experience erratic behaviour or else nothing works.
Obviously I can set up a template somewhere which would return whether or not the user is logged in or if there is an active session, however this would then involve me either continuously checking that template via an ajax call or else checking the template before I process any other calls. So I'm just wondering if there is a way to kick the user out or redirect them to the login page when a session ends or something similar?
I want to avoid any unnecessary calls to templates, etc. so ideally there will be a more elegant approach out there, or even an existing module or extension. I have plenty of experience in developing third_party add-ons for EE so that's not an issue. Just looking for ideas really :)
Thanks in advance, Conor