More accurate timing for extend session dialog

* We found setTimeout() was not keeping accurate time on the browser
* The session on the server was expired, yet in some cases the extend session dialog was still been shown
* New timing logic is self correcting by referencing the system time