asp.net - .NET Session not working -
This is a weird, but hopefully someone can give me an idea here. I am entering some value in the session in my app in Global.asax
session_start session_start
session
variable.
Strange sometimes it works, and after that no change will start giving me this error:
"Session status can be used only when
enabled session date
is set tocorrect
, either in the configuration file or in thepage
instructions. Please also ensure that theSystem.Web.SessionStateModule
or the custom session status module contains& lt; Configuration & gt; \ & lt; system.web & gt; \ & lt; httpModules & gt;
in the section configuration. "
I have seen and different ways of enabling the session in all searched web.config
now looks like this:
& lt; System.web & gt; ... & lt; SessionState mode = "infrac" statementconc string = "TCPIP = 127.0.0.1: 42424" sqlConnectionString = "Data Source = 127.0.0.1; TrustedConnect = Yes" Cookieleys = "Fotal" Timeout = "20" /> & Lt; Globalization Request Encoding = "UTF-8" response encoding = "UTF-8" /> & Lt; HttpHandlers & gt; & Lt; Action = Add, "Post, Gate" path = "Ajax / * .hashx" type = "Ajax.PageHandlerFactory, Ajax" /> & Lt; Verb = delete "*" path = "*. Asmx" /> & Lt; Verb = "*" path = "*. Asmx" valid = "false" type = "System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, version = 3.5.0.0, culture = neutral, publicKeyToken = 31BF3856AD364E35 "/> & Lt; Verb = "*" path = "* _ AppService.axd" Valid = "wrong" type = "System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, version = 3.5.0.0, culture = neutral, PublicKeyToken = 31BF3856AD364E35 "/> & Lt; Verb = "GET, HEAD" path = "ScriptResource.axd" valid = "false" type = "System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version = 3.5.0.0, Culture = Neutral, PublicKeyToken = 31BF3856AD364E35" /> & Lt; / HttpHandlers & gt; & Lt; XhtmlConformance mode = "Legacy" /> & Lt; Pages & gt; & Lt ;! - enableSessionState = "true" autoEventWireup = "true" Enable ViewState = "true" enableViewStateMac = "true" - & gt; & Lt; Control & gt; & Lt; Add tagPrefix = "asp" namespace = "System.Web.UI" assembly = "System.Web.Extensions, version = 3.5.0.0, culture = neutral, publicKeyToken = 31BF3856AD364E35" /> & Lt; Add tagPrefix = "asp" namespace = "System.Web.UI.WebControls" assembly = "System.Web.Extensions, version = 3.5.0.0, culture = neutral, publicKeyToken = 31BF3856AD364E35" /> & Lt; / Control & gt; & Lt; / Pages & gt; & Lt; HttpModules & gt; & Lt ;! - & lt; Add name = "session" type = "System.Web.SessionState.SessionStateModule" /> - & gt; & Lt; Add name = "ScriptModule" type = "System.Web.Handlers.ScriptModule, System.Web.Extensions, Version = 3.5.0.0, Culture = Neutral, PublicKeyToken = 31BF3856AD364E35" /> & Lt; / HttpModules & gt; & Lt; /system.web>
You can see that I have some things, especially enableSessionState = "true"
and
Because they were never before and it was always used to work but I have enabled it with both of them, one or the other, it does not just make a difference.
This is an app that has been in production for many years, I'm only adding minor titles, which is probably the biggest "titlebar" page, and is upgrading from 2.0 to 3.5. I did not try to add the enabled session date
page instructions because it was not working in web.config
I do not know why it will work directly on the page < / P>
Anyone else have any other ideas?
Thanks, Jeff
BREAKPOINTS!
I had set breakpoints in the Creator Pages of the base page, and the main page, as well as session_start and onin A coworker removed all the breakpoints in the debugger and the problem disappeared!
Uh!
Comments
Post a Comment