Hi i am trying to open popup session expire before 15 min but when i set 120 min in webconfig then minutes is showing wrong minutes
so please help me
What I have tried:
- $(function () {
- $("#dialog").dialog({
- autoOpen: false,
- modal: true,
- title: "Session Expiration Warning",
- buttons: {
- "Extend Session": function () {
- ResetSession();
- },
- Logout: function () {
- CloseSession();
- },
- Close: function () {
- $(this).dialog('close');
- }
- }
- });
- });
- function SessionExpireAlert(timeout) {
- var minutes = timeout / 1000/60-1;
- var seconds = 59;
- $('#seconds').html(minutes + ':' + seconds);
- var interval = setInterval(function () {
-
-
-
-
-
-
- --seconds;
- minutes = (seconds < 0) ? --minutes : minutes;
- if (minutes < 0) clearInterval(interval);
- seconds = (seconds < 0) ? 59 : seconds;
- seconds = (seconds < 10) ? '0' + seconds : seconds;
- $('#seconds').html(minutes + ':' + seconds);
- }, 1000);
- setTimeout(function () {
-
- $('#dialog').dialog('open');
- }, timeout - 900 * 1000);
- setTimeout(function () {
- window.location.href = "../../../User/SessionExpired";
- }, timeout);
- };
- function ResetSession() {
-
- window.location = window.location.href;
- };
- function CloseSession() {
-
- window.location.href = "../../../User/SessionExpired";
- };
- Response.Cache.SetCacheability(HttpCacheability.NoCache);
- if (!this.IsPostBack)
- {
- Session["Reset"] = true;
- Configuration config = WebConfigurationManager.OpenWebConfiguration("~/Web.Config");
- SessionStateSection section = (SessionStateSection)config.GetSection("system.web/sessionState");
- var timeout = section.Timeout.TotalMinutes * 1000 * 60;
- ClientScript.RegisterStartupScript(this.GetType(), "SessionAlert", "SessionExpireAlert(" + timeout + ");", true);
- }
- <sessionstate mode="InProc" timeout="120">