[eluser]MindFeed[/eluser]
I am working on an application where in, I need to show Alert message before session gets time out. I thought of two ways of doing it, but none of them is leading me where I want to be.
1. Javascript setTimeOut()
=> If I do it this way, and write something like
window.setTimeout("timeOut()",sess_expiration*1000) on common view template, it execute 'timeOut()' function after specified time limit. That's good for normal HTML pages what about if i have Ajax calls within page !
2. Ajax Calls To find remaining session time
=> If I do it this way, and write something in my common view template, to call some function at controller to check the remaining session time, this will update the session everytime I hit my controller and I never get timed out.
$remainingSessTime = ($this->config->config["sess_expiration"] - (time()-$this->session->userdata["last_activity"])
Any help highly appreciated!!
Thanks,
Bhargav