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. Session timeout in Web [modified]

Session timeout in Web [modified]

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netsysadmin
7 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.
  • S Offline
    S Offline
    Shivan Nandan
    wrote on last edited by
    #1

    Dear friends, My ASP.Net site works perfectly in local network. But after uploading in the net, session times out frequently. I have 2 session variable.One is declared ( CompanyTitle) at Global.asax(Session_Start event), another in login page ( userName). The session variable declared in Global.asax is available in all pages, the other variable is not. It gives an error as "Object variable is not set to an instance.....". After that I declared this variable in Global.asax(Session_Start event) with "" as its default value. Now the problem is that the UserName session variable is reset into "" frequently. my session entry in web.config is as <sessionstate mode="InProc" cookieless="UseCookies" timeout="60" /> Please advice me on this problem.

    Shivanandan C V

    modified on Monday, April 13, 2009 1:32 AM

    A 1 Reply Last reply
    0
    • S Shivan Nandan

      Dear friends, My ASP.Net site works perfectly in local network. But after uploading in the net, session times out frequently. I have 2 session variable.One is declared ( CompanyTitle) at Global.asax(Session_Start event), another in login page ( userName). The session variable declared in Global.asax is available in all pages, the other variable is not. It gives an error as "Object variable is not set to an instance.....". After that I declared this variable in Global.asax(Session_Start event) with "" as its default value. Now the problem is that the UserName session variable is reset into "" frequently. my session entry in web.config is as <sessionstate mode="InProc" cookieless="UseCookies" timeout="60" /> Please advice me on this problem.

      Shivanandan C V

      modified on Monday, April 13, 2009 1:32 AM

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      Shivan Nandan wrote:

      my session entry in web.config is as

      you web.config setting is not coming properly. While posting web.config setting, make sure you have checked "Ignore HTML tags in this message (good for code snippets)" Check box.

      Shivan Nandan wrote:

      But after uploading in the net, session times out frequently.

      You want to mean after deployed into IIS?

      Shivan Nandan wrote:

      the other variable is not. It gives an error as "Object variable is not set to an instance.....".

      How did you add the value in session?

      Shivan Nandan wrote:

      Now the problem is that the UserName session variable is reset into "" frequently.

      Means you are getting the value some times and its got reset frequently. Are you using any Application Pool in IIS ? Does it recycling for any reason ?

      cheers, Abhijit CodeProject MVP

      S 1 Reply Last reply
      0
      • A Abhijit Jana

        Shivan Nandan wrote:

        my session entry in web.config is as

        you web.config setting is not coming properly. While posting web.config setting, make sure you have checked "Ignore HTML tags in this message (good for code snippets)" Check box.

        Shivan Nandan wrote:

        But after uploading in the net, session times out frequently.

        You want to mean after deployed into IIS?

        Shivan Nandan wrote:

        the other variable is not. It gives an error as "Object variable is not set to an instance.....".

        How did you add the value in session?

        Shivan Nandan wrote:

        Now the problem is that the UserName session variable is reset into "" frequently.

        Means you are getting the value some times and its got reset frequently. Are you using any Application Pool in IIS ? Does it recycling for any reason ?

        cheers, Abhijit CodeProject MVP

        S Offline
        S Offline
        Shivan Nandan
        wrote on last edited by
        #3

        Hi, After deploying also , I get the same kind of error.But now I have uploaded all files ie, aspx,aspx.cs,cs,web.config,Global.asax etc. The first variable is added in Session_Start event, as Session.Add("CompanyTitle","XYZ") The other variable in protected void btnLogin_Click(object sender, EventArgs e) { // value retrieval code from Database Session["UserName"]=UserName; } The problem is that whenever I retrieve the session variable "UserName" in some other page, nearly after 1 minute it gives the error "Object variable not set to an instance..." Shivanandan C V

        A 1 Reply Last reply
        0
        • S Shivan Nandan

          Hi, After deploying also , I get the same kind of error.But now I have uploaded all files ie, aspx,aspx.cs,cs,web.config,Global.asax etc. The first variable is added in Session_Start event, as Session.Add("CompanyTitle","XYZ") The other variable in protected void btnLogin_Click(object sender, EventArgs e) { // value retrieval code from Database Session["UserName"]=UserName; } The problem is that whenever I retrieve the session variable "UserName" in some other page, nearly after 1 minute it gives the error "Object variable not set to an instance..." Shivanandan C V

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #4

          Shivan Nandan wrote:

          The problem is that whenever I retrieve the session variable "UserName" in some other page, nearly after 1 minute it gives the error "Object variable not set to an instance..."

          It means you are getting the value from session for sometimes. Yes | No ? Did you gone through all the questions that I have asked you earlier ? What is IIS settings fro Session Time Out, What about IIS Recycling ?

          cheers, Abhijit CodeProject MVP

          S 1 Reply Last reply
          0
          • A Abhijit Jana

            Shivan Nandan wrote:

            The problem is that whenever I retrieve the session variable "UserName" in some other page, nearly after 1 minute it gives the error "Object variable not set to an instance..."

            It means you are getting the value from session for sometimes. Yes | No ? Did you gone through all the questions that I have asked you earlier ? What is IIS settings fro Session Time Out, What about IIS Recycling ?

            cheers, Abhijit CodeProject MVP

            S Offline
            S Offline
            Shivan Nandan
            wrote on last edited by
            #5

            Hosting people told that they have set it to 60 minutes. About recycling I have no idea.

            Shivanandan C V

            A 1 Reply Last reply
            0
            • S Shivan Nandan

              Hosting people told that they have set it to 60 minutes. About recycling I have no idea.

              Shivanandan C V

              A Offline
              A Offline
              Abhijit Jana
              wrote on last edited by
              #6

              Shivan Nandan wrote:

              About recycling I have no idea.

              If you are confident about your code, then problem is only with the recycling of Application Pool. Ask you hosting people to create a separate application pool for you site and assign that application pool to your site, and then test. Good luck !!

              cheers, Abhijit CodeProject MVP

              S 1 Reply Last reply
              0
              • A Abhijit Jana

                Shivan Nandan wrote:

                About recycling I have no idea.

                If you are confident about your code, then problem is only with the recycling of Application Pool. Ask you hosting people to create a separate application pool for you site and assign that application pool to your site, and then test. Good luck !!

                cheers, Abhijit CodeProject MVP

                S Offline
                S Offline
                Shivan Nandan
                wrote on last edited by
                #7

                Thank You

                Shivanandan C V

                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