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. Moving from Session mode InProc to StateServer

Moving from Session mode InProc to StateServer

Scheduled Pinned Locked Moved ASP.NET
phphelpworkspace
6 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
    Steve van Niman
    wrote on last edited by
    #1

    This is so FRUSTRATING... I was losing session information when embedding an iFrame inside a PHP site, so decided to switch from InProc mode of sessions to StateServer. Made/added the following lines to my web.config: <sessionState mode="StateServer" timeout="60" cookieless="AutoDetect" stateConnectionString="tcpip=localhost:42424" /> <pages enableSessionState="true"> <httpModules> <add name="Session" type="System.Web.SessionState.SessionStateModule" /> and yet, the first time I touch a Session variable I get a: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration. I am using Master and Pages and the Session is in the Master Page_Load code behind. Any help is greatly appreciated.

    A S 2 Replies Last reply
    0
    • S Steve van Niman

      This is so FRUSTRATING... I was losing session information when embedding an iFrame inside a PHP site, so decided to switch from InProc mode of sessions to StateServer. Made/added the following lines to my web.config: <sessionState mode="StateServer" timeout="60" cookieless="AutoDetect" stateConnectionString="tcpip=localhost:42424" /> <pages enableSessionState="true"> <httpModules> <add name="Session" type="System.Web.SessionState.SessionStateModule" /> and yet, the first time I touch a Session variable I get a: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration. I am using Master and Pages and the Session is in the Master Page_Load code behind. Any help is greatly appreciated.

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

      Steve van Niman wrote:

      I was losing session information when embedding an iFrame inside a PHP site,

      So, you want to maintain Session for two different site ? Have a look into this article, It may help you Exploring Session in ASP.Net[^]

      Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Visit My Latest Article : Beginner's Guide : Exploring IIS 6.0 With ASP.NET

      S 1 Reply Last reply
      0
      • A Abhijit Jana

        Steve van Niman wrote:

        I was losing session information when embedding an iFrame inside a PHP site,

        So, you want to maintain Session for two different site ? Have a look into this article, It may help you Exploring Session in ASP.Net[^]

        Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Visit My Latest Article : Beginner's Guide : Exploring IIS 6.0 With ASP.NET

        S Offline
        S Offline
        Steve van Niman
        wrote on last edited by
        #3

        No - just one site. Just need to get it out of IIS. Server managing sessions is the same server; however, if this is in place, then I am set to start a server farm if necessary.

        A 1 Reply Last reply
        0
        • S Steve van Niman

          No - just one site. Just need to get it out of IIS. Server managing sessions is the same server; however, if this is in place, then I am set to start a server farm if necessary.

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

          what about Iframe inside in PHP Site? I am not able to understand section ?

          Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Visit My Latest Article : Beginner's Guide : Exploring IIS 6.0 With ASP.NET

          S 1 Reply Last reply
          0
          • A Abhijit Jana

            what about Iframe inside in PHP Site? I am not able to understand section ?

            Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Visit My Latest Article : Beginner's Guide : Exploring IIS 6.0 With ASP.NET

            S Offline
            S Offline
            Steve van Niman
            wrote on last edited by
            #5

            Please don't worry about iFrame in PHP at this point. I can't get this to run as a simple website on my machine...

            1 Reply Last reply
            0
            • S Steve van Niman

              This is so FRUSTRATING... I was losing session information when embedding an iFrame inside a PHP site, so decided to switch from InProc mode of sessions to StateServer. Made/added the following lines to my web.config: <sessionState mode="StateServer" timeout="60" cookieless="AutoDetect" stateConnectionString="tcpip=localhost:42424" /> <pages enableSessionState="true"> <httpModules> <add name="Session" type="System.Web.SessionState.SessionStateModule" /> and yet, the first time I touch a Session variable I get a: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration. I am using Master and Pages and the Session is in the Master Page_Load code behind. Any help is greatly appreciated.

              S Offline
              S Offline
              Steve van Niman
              wrote on last edited by
              #6

              Wow - sometimes it amazes me as to how frequently the "website" or "project" becomes corrupted in Visual Studio. At wits end, started brand new website and literally copied over web.config from website giving me issues with sessionState - StateServer. Worked out of the gates... Ok so my config was correct, so why would my existing site not work? Went to \windows\Microsoft.Net\Framework\n.n.nnn.release\Temporary ASP.NET Files\ and deleted all websites - still a no go. Then remembering what one of my friends told me, "It is common for the solution/website to become corrupted. When this happens, copy all files to a new directory and start over. Bingo - works out of the gate. Lost two days on something that should have worked because the platform I'm on cannot remain uncorupted...

              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