Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37670

How can I refresh browser sessions without refreshing the page?

$
0
0
by Matt Bury.  

Hi,

I'm sure we're all familiar with the issue of online learning activities taking longer than the $CFG->sessiontimeout variable allows: the learner clicks next or submit only to be met by a login page and their work may be lost.

Is there a way to refresh the browser session without refreshing the page, e.g. an API that can be called with JS or from a web client?

My idea is to monitor keyboard and mouse use. As long as they're active, i.e. someone's working on the page, the client keeps the session alive by refreshing it whenever it gets near to the $CFG->sessiontimeout (on a timer). If they're inactive and it gets close to the end on the session, the client sounds an alarm. If the user doesn't respond, it times out. If there's mouse/keyboard activity, it refreshes the session.

Does that make sense? Is there a function I could call to do this without leaving the page or opening a new page?

Thanks in advance smile


Viewing all articles
Browse latest Browse all 37670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>