[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Javascript popup based on application session timeout time.

Posted on 2007-08-01
4
Medium Priority
?
407 Views
Last Modified: 2010-07-27
Hey there guys,

I have been doing some searching on this and have found some scripts to do this but none of whihc seem to be accurate and variable to the appl;ication sessions timeout setting.

In my global.asax file on my application at the session_start portion of the site i emediatly set a few different session for use throughout the site. i wish to popup a alert window 60 seconds before my app sessions timeout.

Assume that i do not know the exact timeout minutes, what i am looking to do is pull this minute value from my app and into the javascript.

How please?

Nugs
0
Comment
Question by:Nugs
  • 2
  • 2
4 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 19615212
So something like this:

<script>
var timeout = new Date();
timeout.setMinutes(timeout.getMinutes()+(<%= session.timeout %>-1)); // minutes I assume
var tId = "";
function check() {
  var now = new Date();
  if (now=>timeout) {
    clearInterval(tId)
    alert('One minute to timeout')
  }
}
tId=setInterval('check()',1000); // 1 second
</script>
0
 
LVL 2

Author Comment

by:Nugs
ID: 19618687
I get a sytax error on this... from these lines?

...
        {
          var now = new Date();
          if (now=>timeout)
          {
...
 Nugs
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 2000 total points
ID: 19623514
oops

>=

greater/equal
0
 
LVL 2

Author Comment

by:Nugs
ID: 19627865
thanks

Nugs
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question