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. Visual Basic
  4. Sessions lost

Sessions lost

Scheduled Pinned Locked Moved Visual Basic
helptutorial
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.
  • P Offline
    P Offline
    partt
    wrote on last edited by
    #1

    When a user logs in to my web app, I save their login id as Public Shared so that I can reference it later. Sometimes when it is referenced later, it will grab the login id from someone else's session who is also running the app. I tried saving the login id as Session("loginid"), it works ok for a while, then it loses it and goes to null. No messages are coming up saying that the session has been lost, any ideas on what could be wrong or how to fix this would help out a lot. Thank You!

    C 1 Reply Last reply
    0
    • P partt

      When a user logs in to my web app, I save their login id as Public Shared so that I can reference it later. Sometimes when it is referenced later, it will grab the login id from someone else's session who is also running the app. I tried saving the login id as Session("loginid"), it works ok for a while, then it loses it and goes to null. No messages are coming up saying that the session has been lost, any ideas on what could be wrong or how to fix this would help out a lot. Thank You!

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      partt wrote: I save their login id as Public Shared partt wrote: when it is referenced later, it will grab the login id from someone else's session That is the correct behaviour - Public Shared mean that all instances of the class will share the same value so it should not be used for storing individual user IDs as a web application is a multi-user system and lots of users will be using it at the same time. partt wrote: Session("loginid"), it works ok for a while, then it loses it and goes to null That is most likely because the session has timed out. There is a setting in the web.config to make the session longer if you need to. The default is 20 minutes, so if the user does not interact with the web application for 20 minutes their session will end so that the server can free up resources to deal with users that are actually using the system. At this point the timed-out user will need to log in again. Does this help?


      Do you want to know more? WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums

      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