Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm working on an upgrade from an Umbraco 4.0.2 instance to 6.0.0 and are having problem with the Session object.
The session object can be used "on the page", for example this inline razor macro works in a my master template:
<umbraco:Macro runat="server" language="cshtml">@{ HttpContext.Current.Session["test"] ["test"] = "Hey";}
Value: @ HttpContext.Current.Session["test"] ["test"].ToString();</umbraco:Macro>
But in the custom role provider that's implemented in the solution the exact same line of code don't work. The session object will be null.
I have read all these posts in the forum and can't find a way around this:
http://jgvimalan.wordpress.com/2011/05/31/httpcontext-current-return-null-in-iis-7/http://stackoverflow.com/questions/218057/httpcontext-current-session-is-null-when-routing-requests
This settings is by there by default in V6:
<modules runAllManagedModulesForAllRequests="True">
I've also tried this:
<modules runAllManagedModulesForAllRequests="True"> <remove name="Session" /> <add name="Session" type="System.Web.SessionState.SessionStateModule"/>
Anyone who know what I could try more?
Any solutions to this? I'm having sort of a similar problem.
I'm trying to use Session in a httpmodule on Umbraco 6.1.6 that is running in MVC rendering.
The HttpContex.Current.Session object is always null in my module.
I've added the lines above to web.config and I've made the module implement the IRequiresSessionState interface.
Still no luck :(
Any help greatly appreciated, I'm slowly going nuts here..
have you debugged and looked at what the custom proider object contains? Have you checked the session for the keys?
Charlie :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
(V6.0.0) Session object is always null
I'm working on an upgrade from an Umbraco 4.0.2 instance to 6.0.0 and are having problem with the Session object.
The session object can be used "on the page", for example this inline razor macro works in a my master template:
<umbraco:Macro runat="server" language="cshtml">
@{
HttpContext.Current.Session["test"] ["test"] = "Hey";
}
Value: @ HttpContext.Current.Session["test"] ["test"].ToString();
</umbraco:Macro>
But in the custom role provider that's implemented in the solution the exact same line of code don't work. The session object will be null.
I have read all these posts in the forum and can't find a way around this:
http://jgvimalan.wordpress.com/2011/05/31/httpcontext-current-return-null-in-iis-7/
http://stackoverflow.com/questions/218057/httpcontext-current-session-is-null-when-routing-requests
This settings is by there by default in V6:
<modules runAllManagedModulesForAllRequests="True">
I've also tried this:
Anyone who know what I could try more?
Any solutions to this? I'm having sort of a similar problem.
I'm trying to use Session in a httpmodule on Umbraco 6.1.6 that is running in MVC rendering.
The HttpContex.Current.Session object is always null in my module.
I've added the lines above to web.config and I've made the module implement the IRequiresSessionState interface.
Still no luck :(
Any help greatly appreciated, I'm slowly going nuts here..
have you debugged and looked at what the custom proider object contains? Have you checked the session for the keys?
Charlie :)
is working on a reply...