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. Web Development
  3. ASP.NET
  4. The Session, Master Pages, and you

The Session, Master Pages, and you

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netquestionlearning
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.
  • K Offline
    K Offline
    Keith Andersch
    wrote on last edited by
    #1

    Hi all. I have a web app which uses master pages. Whithin the master page, I declare some session variables. I use these session variables in the content pages. Of course, before I use the variables in the content pages, I check to see if they are null and act accordingly. This, for the most part, works. However, a few users will tend to leave their windows open for more than 20 minutes, killing the session. They try to go somewhere else in the web app and gets the nice exception is thrown because the session variables are null. (I redirect the exceptions to a nice looking error page) I'm starting to think that having the session variables declared in the master page is a bad choice on my part. In my readings of Asp.Net, I found that the content pages are created first and then the master pages which is probably leading to the session vars not being reloaded in time. Has anybody else seen this issue? Is there a simple workaround or am I gonna have to bite the bullet and do some redesigning? Keith

    E 1 Reply Last reply
    0
    • K Keith Andersch

      Hi all. I have a web app which uses master pages. Whithin the master page, I declare some session variables. I use these session variables in the content pages. Of course, before I use the variables in the content pages, I check to see if they are null and act accordingly. This, for the most part, works. However, a few users will tend to leave their windows open for more than 20 minutes, killing the session. They try to go somewhere else in the web app and gets the nice exception is thrown because the session variables are null. (I redirect the exceptions to a nice looking error page) I'm starting to think that having the session variables declared in the master page is a bad choice on my part. In my readings of Asp.Net, I found that the content pages are created first and then the master pages which is probably leading to the session vars not being reloaded in time. Has anybody else seen this issue? Is there a simple workaround or am I gonna have to bite the bullet and do some redesigning? Keith

      E Offline
      E Offline
      Expert Coming
      wrote on last edited by
      #2

      Each time a page is requested from the server your session timeout is reset. If you are not worried about a million users using the page, and leaving it open try this. Make a 0 sized frame, and make some timer refresh that page every 19 minutes.

      The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.

      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