Click here to Skip to main content
14,774,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have set Session Time out in web.config to 30 minutes but i want to add idle time out to 30 minutes but it is not done. because when i set Session time out it logged out after 30 minutes when i m working but it should be an idle time out when my system is free and i m not working on my application. pls give the solution, it is urgent.
Posted

Session timeout when you are working on website ? amazing, i never see such thing.
anyways check this article. will help you. Alert Session Time out in ASP.NET[^]
   
Comments
[no name] 28-Dec-11 1:29am
   
Thanx a lot
<script language="javascript" type="text/javascript">
        var sessionTimeoutWarning = 1;
        var sessionTimeout = '<%= Session.Timeout %>';
        //alert(sessionTimeout);
        var sTimeout = parseInt(sessionTimeoutWarning) * 60 * 1000;
        //        setTimeout('SessionWarning()', sTimeout);
        setTimeout('SessionWarning()', sessionTimeout);

        function SessionWarning() {
            var img = new Image(1, 1);
            img.src = '<%= System.Configuration.ConfigurationSettings.AppSettings["SitePath"].ToString()%>/KeepAlive.aspx?date=' + escape(new Date());
//            var message = "Your session will expire in another " +
//	(parseInt(sessionTimeout) - parseInt(sessionTimeoutWarning)) +
//	" mins! Please Save the data before the session expires";
//            alert(message);
        }
</script>
   
v2
Comments
[no name] 29-Dec-11 4:45am
   
Edited: Added "pre" tag.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900