Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Session timeout in IIS or web.config - precedence

Session timeout in IIS or web.config - precedence

Scheduled Pinned Locked Moved .NET (Core and Framework)
windows-adminquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VK Cadec
    wrote on last edited by
    #1

    Hi, I would like to know which would take precedence? If the timeout is set at 20 minutes in IIS and 30 minutes in web.config - at time would the application timeout? Thanks.

    W 1 Reply Last reply
    0
    • V VK Cadec

      Hi, I would like to know which would take precedence? If the timeout is set at 20 minutes in IIS and 30 minutes in web.config - at time would the application timeout? Thanks.

      W Offline
      W Offline
      Waleed Eissa
      wrote on last edited by
      #2

      web.config as far as I know .. you could test it easily yourself if you want to be more sure .. in global.asax, write some code in session_start and session_end to save the current time in a log file .. For example, in global.asax:

      void Session_Start(object sender, EventArgs e)
      {
      using (StreamWriter sw = File.AppendText(Server.MapPath("/session.log")))
      {
      sw.WriteLine(String.Format("Session started at {0}", DateTime.Now.ToString()));
      }
      }

      void Session_End(object sender, EventArgs e)
      {
      using (StreamWriter sw = File.AppendText(Server.MapPath("/session.log")))
      {
      sw.WriteLine(String.Format("Session ended at {0}", DateTime.Now.ToString()));
      }
      }

      and don't forget to add this at the top of the global.asax file (just below <%@ Application Language= ...):

      <%@ Import Namespace="System.IO" %>

      Waleed Eissa .NET Software Developer in Sydney

      modified on Wednesday, December 26, 2007 12:16:37 AM

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups