I'm working on a project that is using IronPython for ASP.NET and can't seem to get simple session state to work. I don't know if this has anything to do with the IRequiresSessionState marker interface not being implemented in the HttpHandler used by the
CTP or maybe I'm just doing something wrong.
I have configured my web.config to enable session state like so:
I have not tried IronPython but what I would do is try the other modes of session state besides InProc. Read up on this as this gets quite complicated. By the way, 120 minutes per session is excessive. In a live environment serving many users, this would
drain the server memory. The default of 20 should suffice.
There seems to be an issue with enabling sesstion state via pages/enableSessionState setting in web.config. We will investigate. For now, Michael, have you tried to enable it from page directive on the aspx file? For example,
i have a base class (in the App_Code folder) derived from System.Web.UI.Page; this base class does not have a aspx page for itself.
but other aspx-pages derive from the base class.
i cannot use Session in the base class.
i tried <pages buffer="true" enableSessionState="true" /> and <pages enableSessionState="true" /> in the webconfig (under node <system.web>) but then i get an 500 internal server error, for every page in the project! i use Asp.net 2 and VS2008!
server error 500 is now gone; but cannot i use Session or base.Session in my base class? the base class is in the App-Code folder and is derived from System.Web.UI.Page.
mbeauregard
Member
2 Points
3 Posts
Can't enable session state
Jan 26, 2007 10:14 PM|LINK
I'm working on a project that is using IronPython for ASP.NET and can't seem to get simple session state to work. I don't know if this has anything to do with the IRequiresSessionState marker interface not being implemented in the HttpHandler used by the CTP or maybe I'm just doing something wrong.
I have configured my web.config to enable session state like so:
Michael Beauregard
ASP.NET IronPython sessionState
ask_Scotty
Contributor
4146 Points
707 Posts
Re: Can't enable session state
Jan 26, 2007 10:33 PM|LINK
Hello my friend,
I have not tried IronPython but what I would do is try the other modes of session state besides InProc. Read up on this as this gets quite complicated. By the way, 120 minutes per session is excessive. In a live environment serving many users, this would drain the server memory. The default of 20 should suffice.
Kind regards
Scotty
qingye
Member
200 Points
47 Posts
Microsoft
Re: Can't enable session state
Jan 27, 2007 07:24 AM|LINK
There seems to be an issue with enabling sesstion state via pages/enableSessionState setting in web.config. We will investigate. For now, Michael, have you tried to enable it from page directive on the aspx file? For example,
<%
@ Page Language="IronPython" CodeFile="Default.aspx.py" EnableSessionState="true" %>I was able to get below code working on an IronPython page:
def Page_Load():
Session.Add("test", "some test value")
Response.Write(Session["test"])
Response.Write(Session.IsCookieless)
Response.Write(Session.Timeout)
settings in <sessionState> section are all effective.
Please let us know if this doesn't help.
Thanks!
Qing
mbeauregard
Member
2 Points
3 Posts
Re: Can't enable session state
Jan 28, 2007 07:11 PM|LINK
Setting enableSessionState in the page directive works. Thanks for your help.
Michael
NirvanaViper
Member
18 Points
9 Posts
Re: Can't enable session state
Jun 10, 2007 05:16 PM|LINK
Kaan
Member
237 Points
286 Posts
Re: Can't enable session state
Jul 25, 2007 02:03 PM|LINK
Hi Viper do u use tinyMCE in an updatepanel?
romu0
Member
6 Points
3 Posts
Re: Can't enable session state
Jun 18, 2009 10:35 AM|LINK
i have a base class (in the App_Code folder) derived from System.Web.UI.Page; this base class does not have a aspx page for itself.
but other aspx-pages derive from the base class.
i cannot use Session in the base class.
i tried <pages buffer="true" enableSessionState="true" /> and <pages enableSessionState="true" /> in the webconfig (under node <system.web>) but then i get an 500 internal server error, for every page in the project! i use Asp.net 2 and VS2008!
Any ideas?
romu0
Member
6 Points
3 Posts
Re: Can't enable session state
Jun 18, 2009 10:41 AM|LINK
server error 500 is now gone; but cannot i use Session or base.Session in my base class? the base class is in the App-Code folder and is derived from System.Web.UI.Page.
romu0
Member
6 Points
3 Posts
Re: Can't enable session state
Jun 18, 2009 11:00 AM|LINK
solved.
System.Web.SessionState.HttpSessionState session = HttpContext.Current.Session;