Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing javascript to reset the meta tag to prevent it from refreshing the page
    primarykey
    data
    text
    <p>We have an legacy application (mixture of classic ASP and ASP.net) that has a few Ajax content rich pages.The expectation is that the users of the site performs a set of tasks on the page that can span a fair amount of time say, 15-30 minutes.</p> <p>One of the requirements is that users logging in to the site be automatically logged out after 15 mins of inactivity. This is currently being achieved by using the meta tags for redirecting the user to the logout page after 15 minutes of inactivity in the page.</p> <p><code>&lt;meta name='Refresh' http-equiv="Refresh" content="900;URL=/someurl/logout.asp"&gt;</code></p> <p>The problem we're having is that the browser doesnt think there has been any activity on the page despite having many AJAX interactions with the server. So after the 15 minutes of what the browser thinks as inactivity, the user is logged out automatically even if they are in the middle of doing something.</p> <p>Inspired by this <a href="http://www.mail-archive.com/jquery-en@googlegroups.com/msg04039.html" rel="nofollow noreferrer">message board post</a> we tried to fix the annoyance by using javascript(JQuery) like so</p> <p>The below would be an event handler such as clicking of the save on the page etc. for simplicity here is the page load to modify the refresh time to 5 seconds</p> <pre><code>$(document).ready(function() { var selector = 'meta[name=Refresh]'; var content = $(selector).attr("content"); //"900;URL=/someurl/logout.asp" $(selector).attr("content", "5;URL=/someurl/logout.asp"); }); </code></pre> <p>The intent being (re)setting the meta tag content the page refresh timer would be reset. Unfortunately this doesnt seem to work (in IE). </p> <p>Since this is a legacy application, some of the decisions i.e. to use meta tags etc. are baked in. The question is, is there a way to get meta tag refresh to peacefully co-exist with an Ajax application? Am I doing something wrong and is there a way to solve this problem? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload