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. Web Development
  3. ASP.NET
  4. Session Problem

Session Problem

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netsysadmintutorial
6 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.
  • M Offline
    M Offline
    Malleswar1234
    wrote on last edited by
    #1

    Hi, I am developing ASP.Net application in VS2003. From when user login, I am maintaining one session variable. Session["user"] = t1.text; some think like this. and making it null and abandon when logout is clicked. Session["user"] = "" Session.Abandon() ; When I run my code on localhost I dont have any problem. every thing works perfectly. but when I deploy my application to main server then aumatically my session get expires , I mean session variable is becoming is null. This does not happen regularly. It happens after few transactions. Even unable to replicate when exactly this is happening. I kept timeout 20 minutes.Then also even while operating it expires. I am already frustrated with this issue by chanding in web.config and many replacements in my code. but no use. Can any please guide me? Thanks In Advance

    F K P 3 Replies Last reply
    0
    • M Malleswar1234

      Hi, I am developing ASP.Net application in VS2003. From when user login, I am maintaining one session variable. Session["user"] = t1.text; some think like this. and making it null and abandon when logout is clicked. Session["user"] = "" Session.Abandon() ; When I run my code on localhost I dont have any problem. every thing works perfectly. but when I deploy my application to main server then aumatically my session get expires , I mean session variable is becoming is null. This does not happen regularly. It happens after few transactions. Even unable to replicate when exactly this is happening. I kept timeout 20 minutes.Then also even while operating it expires. I am already frustrated with this issue by chanding in web.config and many replacements in my code. but no use. Can any please guide me? Thanks In Advance

      F Offline
      F Offline
      Felipe Dalorzo
      wrote on last edited by
      #2

      Check your cookies settings, ASP.NET handles the session in cookies, if your browser doesn't allow cookies then you will have problems like those you mentioned. Let me know if that fix your problem. Greetings, :laugh: Felipe

      M 1 Reply Last reply
      0
      • F Felipe Dalorzo

        Check your cookies settings, ASP.NET handles the session in cookies, if your browser doesn't allow cookies then you will have problems like those you mentioned. Let me know if that fix your problem. Greetings, :laugh: Felipe

        M Offline
        M Offline
        Malleswar1234
        wrote on last edited by
        #3

        Hi, Thank you for ur reply. but if it is because of cookie, it should not even work on localhost. but Its working fine on localhost. The problem is coming only when I deploy the to server. and browse it. I have allowed all the cookies(by making the security level low). but still the same problem occurs. Can you please guide me? Thanks In Advance

        1 Reply Last reply
        0
        • M Malleswar1234

          Hi, I am developing ASP.Net application in VS2003. From when user login, I am maintaining one session variable. Session["user"] = t1.text; some think like this. and making it null and abandon when logout is clicked. Session["user"] = "" Session.Abandon() ; When I run my code on localhost I dont have any problem. every thing works perfectly. but when I deploy my application to main server then aumatically my session get expires , I mean session variable is becoming is null. This does not happen regularly. It happens after few transactions. Even unable to replicate when exactly this is happening. I kept timeout 20 minutes.Then also even while operating it expires. I am already frustrated with this issue by chanding in web.config and many replacements in my code. but no use. Can any please guide me? Thanks In Advance

          K Offline
          K Offline
          Kissy16
          wrote on last edited by
          #4

          I kept timeout 20 minutes.Then also even while operating it expires. You can also set the session timeout in IIS. Then u will solve ur problem of session expire. like IIS->defaultwebiste->(Urapplication)properties->homedirectory->configuration->options Here u can set the session timeout. Try this.

          kissy

          M 1 Reply Last reply
          0
          • K Kissy16

            I kept timeout 20 minutes.Then also even while operating it expires. You can also set the session timeout in IIS. Then u will solve ur problem of session expire. like IIS->defaultwebiste->(Urapplication)properties->homedirectory->configuration->options Here u can set the session timeout. Try this.

            kissy

            M Offline
            M Offline
            Malleswar1234
            wrote on last edited by
            #5

            Kissy, Thank you very much for ur reply. But I am not getting problem at my local IIS. Its only coming when I deploy to main server. So I need to set the property at the server side. How can I set this at server side. Can you guide me? Do u think this problem is because of this property? If you think please guide me how to set this at server(which is not with me). Do I need to consult Administrator? Thanks in Advance

            1 Reply Last reply
            0
            • M Malleswar1234

              Hi, I am developing ASP.Net application in VS2003. From when user login, I am maintaining one session variable. Session["user"] = t1.text; some think like this. and making it null and abandon when logout is clicked. Session["user"] = "" Session.Abandon() ; When I run my code on localhost I dont have any problem. every thing works perfectly. but when I deploy my application to main server then aumatically my session get expires , I mean session variable is becoming is null. This does not happen regularly. It happens after few transactions. Even unable to replicate when exactly this is happening. I kept timeout 20 minutes.Then also even while operating it expires. I am already frustrated with this issue by chanding in web.config and many replacements in my code. but no use. Can any please guide me? Thanks In Advance

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              You will see this behaviour if your session is running in-proc on a multi-processor system, or in a web-farm/web-garden. What you need to do is change the sessionstate to run under either SQL Server state, or as stateserver. Supposing that you are using the state server, then you need to start the ASP.NET state service on the server and add the following to your web.config.

              >sessionstate 
                    mode="stateserver"
                    cookieless="false" 
                    timeout="20" 
                    sqlconnectionstring="data source=127.0.0.1; user id=user; password=password"
                    server="127.0.0.1" 
                    port="42424" 
                />
              

              Deja View - the feeling that you've seen this post before.

              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