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 problem

Session timeout problem

Scheduled Pinned Locked Moved ASP.NET
helpcss
12 Posts 4 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.
  • N Offline
    N Offline
    nour123
    wrote on last edited by
    #1

    Dear all... I'm handling a login form, where let the user to login in pageA before entering pageB or pageC. When running at localhost, everything was fine. Now the problem is when i put into the webserver. The session timeout within 30sec or less eventhough i had code :- Session("Login") = userLogin in pageA - Session.Timeout = 60 (in pageB & pageC during pageload!) If Session(Login) = Nothing Then respone.redirect(PageA) Else ............... Although I set the session timeout in web.config as well, it didn't work Pls Help! many Thanks!

    Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

    L N 2 Replies Last reply
    0
    • N nour123

      Dear all... I'm handling a login form, where let the user to login in pageA before entering pageB or pageC. When running at localhost, everything was fine. Now the problem is when i put into the webserver. The session timeout within 30sec or less eventhough i had code :- Session("Login") = userLogin in pageA - Session.Timeout = 60 (in pageB & pageC during pageload!) If Session(Login) = Nothing Then respone.redirect(PageA) Else ............... Although I set the session timeout in web.config as well, it didn't work Pls Help! many Thanks!

      Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      There can be number of reasons for the behaviour. Try using SessionMode as StateSever than InProc. As InProc is not reliable. But make sure one thing that: ASP.net State Service is running on server.

      N 1 Reply Last reply
      0
      • L Lost User

        There can be number of reasons for the behaviour. Try using SessionMode as StateSever than InProc. As InProc is not reliable. But make sure one thing that: ASP.net State Service is running on server.

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        Amandeep Singh Bhullar wrote:

        As InProc is not reliable.

        I disagree. What made you to say it is not reliable?

        Navaneeth How to use google | Ask smart questions

        C 1 Reply Last reply
        0
        • N nour123

          Dear all... I'm handling a login form, where let the user to login in pageA before entering pageB or pageC. When running at localhost, everything was fine. Now the problem is when i put into the webserver. The session timeout within 30sec or less eventhough i had code :- Session("Login") = userLogin in pageA - Session.Timeout = 60 (in pageB & pageC during pageload!) If Session(Login) = Nothing Then respone.redirect(PageA) Else ............... Although I set the session timeout in web.config as well, it didn't work Pls Help! many Thanks!

          Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          nour123 wrote:

          The session timeout within 30sec or less eventhough i had code

          Then you have some serious issues in your code. Are you sure the session is set correctly? Also try the points which I pointed out here[^]

          Navaneeth How to use google | Ask smart questions

          N 1 Reply Last reply
          0
          • N N a v a n e e t h

            Amandeep Singh Bhullar wrote:

            As InProc is not reliable.

            I disagree. What made you to say it is not reliable?

            Navaneeth How to use google | Ask smart questions

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

            The prime reason I've seen InProc session being lost is if the app pool is recycled, or IIS is reset because the process that holds the session is lost. With a state server or a state database the session is held outside the process meaning it survives these two events. Also, if you have some daft bugger decide to configure a WebFarm to use InProc state then you will really have some interesting problems.

            Developer Day Scotland 2 - Free community conference Recent blog posts: *Throwing Exceptions *Training Developers * Method hiding or overriding - or the difference between new and virtual

            N 1 Reply Last reply
            0
            • C Colin Angus Mackay

              The prime reason I've seen InProc session being lost is if the app pool is recycled, or IIS is reset because the process that holds the session is lost. With a state server or a state database the session is held outside the process meaning it survives these two events. Also, if you have some daft bugger decide to configure a WebFarm to use InProc state then you will really have some interesting problems.

              Developer Day Scotland 2 - Free community conference Recent blog posts: *Throwing Exceptions *Training Developers * Method hiding or overriding - or the difference between new and virtual

              N Offline
              N Offline
              N a v a n e e t h
              wrote on last edited by
              #6

              Colin Angus Mackay wrote:

              InProc session being lost is if the app pool is recycled, or IIS is reset because the process that holds the session is lost.

              That's right. I have also seen antivirus programs making problems by scanning the configuration files and assemblies.

              Navaneeth How to use google | Ask smart questions

              N 1 Reply Last reply
              0
              • N N a v a n e e t h

                nour123 wrote:

                The session timeout within 30sec or less eventhough i had code

                Then you have some serious issues in your code. Are you sure the session is set correctly? Also try the points which I pointed out here[^]

                Navaneeth How to use google | Ask smart questions

                N Offline
                N Offline
                nour123
                wrote on last edited by
                #7

                Thanks for you friends I used but also i didn't work, why it works in my own iis, and doesn't work in the web host? :mad: :mad: :mad:

                Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

                C 1 Reply Last reply
                0
                • N N a v a n e e t h

                  Colin Angus Mackay wrote:

                  InProc session being lost is if the app pool is recycled, or IIS is reset because the process that holds the session is lost.

                  That's right. I have also seen antivirus programs making problems by scanning the configuration files and assemblies.

                  Navaneeth How to use google | Ask smart questions

                  N Offline
                  N Offline
                  nour123
                  wrote on last edited by
                  #8

                  thanks 4 your reply... i tried this it gives me an error........ sessionState mode="StateServer" stateConnectionString="tcpip=65.182.97.156:42424" cookieless="false" timeout="20" thanx...

                  Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

                  C 1 Reply Last reply
                  0
                  • N nour123

                    Thanks for you friends I used but also i didn't work, why it works in my own iis, and doesn't work in the web host? :mad: :mad: :mad:

                    Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

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

                    nour123 wrote:

                    why it works in my own iis, and doesn't work in the web host?

                    Because they are configured differently? Because it wasn't uploaded properly? Becuase the security context is different? Because you weren't actually using IIS on your machine? (A lot of people mistake Visual Studio's build in web server for IIS. It is different and it responds in subtly different ways) Any number of reasons.

                    Developer Day Scotland 2 - Free community conference Recent blog posts: *Throwing Exceptions *Training Developers * Method hiding or overriding - or the difference between new and virtual

                    1 Reply Last reply
                    0
                    • N nour123

                      thanks 4 your reply... i tried this it gives me an error........ sessionState mode="StateServer" stateConnectionString="tcpip=65.182.97.156:42424" cookieless="false" timeout="20" thanx...

                      Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

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

                      nour123 wrote:

                      it gives me an error........

                      What is the error, you have only detailed your configuration settings.

                      Developer Day Scotland 2 - Free community conference Recent blog posts: *Throwing Exceptions *Training Developers * Method hiding or overriding - or the difference between new and virtual

                      N 1 Reply Last reply
                      0
                      • C Colin Angus Mackay

                        nour123 wrote:

                        it gives me an error........

                        What is the error, you have only detailed your configuration settings.

                        Developer Day Scotland 2 - Free community conference Recent blog posts: *Throwing Exceptions *Training Developers * Method hiding or overriding - or the difference between new and virtual

                        N Offline
                        N Offline
                        nour123
                        wrote on last edited by
                        #11

                        thanks 4 reply... I wrote: sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" cookieless="false" timeout="20" / the error is... Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.

                        Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

                        L 1 Reply Last reply
                        0
                        • N nour123

                          thanks 4 reply... I wrote: sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" cookieless="false" timeout="20" / the error is... Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.

                          Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

                          L Offline
                          L Offline
                          Lost User
                          wrote on last edited by
                          #12

                          Go to Run type services.msc and press enter From the window select the service with name ASP.NET State Service Check its status. If it is not started, then Start this service. This will solve your problem

                          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