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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Losing Global Variables

Losing Global Variables

Scheduled Pinned Locked Moved Visual Basic
questionhtml
3 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
    ken110
    wrote on last edited by
    #1

    After 10 or 20 minutes, my ASPX website loses the Global Variables defined in GLOBAL.asax The following is in Global.asax which has been designated as readonly file. Public Class GlobalVarDefinitions Public GlobalVars As Object Public Company As String End Class Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) Dim GlobalVars As New GlobalVarDefinitions Session("Globals") = GlobalVars Session("Globals").Company = "89" Session("Globals").CompanyName = "Walong" End Sub In the individual aspx programs, the Global Variables are reference like this: ICompany = Session("Globals").Company In HTML as: <%=Session("Globals").CompanyName%> How can I stop losing my Global Session Variables?????

    M 1 Reply Last reply
    0
    • K ken110

      After 10 or 20 minutes, my ASPX website loses the Global Variables defined in GLOBAL.asax The following is in Global.asax which has been designated as readonly file. Public Class GlobalVarDefinitions Public GlobalVars As Object Public Company As String End Class Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) Dim GlobalVars As New GlobalVarDefinitions Session("Globals") = GlobalVars Session("Globals").Company = "89" Session("Globals").CompanyName = "Walong" End Sub In the individual aspx programs, the Global Variables are reference like this: ICompany = Session("Globals").Company In HTML as: <%=Session("Globals").CompanyName%> How can I stop losing my Global Session Variables?????

      M Offline
      M Offline
      Mandar Patankar
      wrote on last edited by
      #2

      Please check the session time out period. In your webconfig file look into SessionState property and look for timeout atribute. This attribute decides the timeout period for your session.

      Mandar Patankar Microsoft Certified professional

      K 1 Reply Last reply
      0
      • M Mandar Patankar

        Please check the session time out period. In your webconfig file look into SessionState property and look for timeout atribute. This attribute decides the timeout period for your session.

        Mandar Patankar Microsoft Certified professional

        K Offline
        K Offline
        ken110
        wrote on last edited by
        #3

        Thanks, Also, appparently the IIS Session Time-out overrides the webconfig file Time-out setting. I found this on the website below: This shows the values you need in the

        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