Welcome Guest, Not a member yet? Register   Sign In
Alert User Before Session Times Out
#1

[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


Messages In This Thread
Alert User Before Session Times Out - by El Forum - 08-18-2009, 03:57 PM
Alert User Before Session Times Out - by El Forum - 08-18-2009, 05:21 PM
Alert User Before Session Times Out - by El Forum - 08-20-2009, 11:37 AM
Alert User Before Session Times Out - by El Forum - 08-20-2009, 01:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB