Blog Exeption

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
4/24/2009 11:44:10 AM
Gravatar
Total Posts 8

Blog Exeption

 Vista Pro

MSSQL 2005

2.3.0.1 MSSQL

 

Added blog feature to a site, added it to a page, created a test article, clicked comments while logged in as admin and I get the exception:

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.

Line 581: if ((Session != null) && (!string.IsNullOrEmpty(Session.SessionID)))

Source File: C:\Sites\MojoPortal\Web\Components\mojoBasePage.cs

 

Thanks,

 

Zack

4/24/2009 1:18:27 PM
Gravatar
Total Posts 18439

Re: Blog Exeption

Hi,

I would have thought that checking if Session was null would avoid any problem like you have reported.

This was a recent change inspired by these links:

http://haacked.com/archive/2009/04/02/csrf-webforms.aspx

http://msdn.microsoft.com/en-us/library/ms972969.aspx

Can you post the actual stack trace so I can see what error needs to be caught there?

In the meantime I assume if you enable session state in IIS it will resolve this error.

Best,

Joe

4/24/2009 1:56:30 PM
Gravatar
Total Posts 8

Re: Blog Exeption

 Hey Joe,

 

Thanks for the reply. It looks like you can't even reference the session object unless it's enabled. Here's the stack:


[HttpException (0x80004005): 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.]
System.Web.UI.Page.get_Session() +2634804
mojoPortal.Web.mojoBasePage.OnInit(EventArgs e) in C:\Sites\MojoPortal\Web\Components\mojoBasePage.cs:581
mojoPortal.Web.BlogUI.BlogView.OnInit(EventArgs e) +79
System.Web.UI.Control.InitRecursive(Control namingContainer) +333
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378

 

P.S. I've been playing around with mojo for the past week, creating skins and a customizable member search feature, and so far I like the framework quite a bit. Just wanted to say thanks!

 

Zack

4/24/2009 2:03:46 PM
Gravatar
Total Posts 8

Re: Blog Exeption

 Joe,

 

Found this on bytes.com maybe helpful:

 

Solved it. Because I was inheriting from Page class, the child
constructor was being called before the base constructor. This means
the Session object hadn't been created yet. I placed the needed code
in an overriden OnLoad event and it all works fine.

4/27/2009 2:02:13 PM
Gravatar
Total Posts 8

Re: Blog Exeption

 Well after playing around a bit trying to fix this issue, I noticed that the url to the article and feed back was incorrect it was "article-name.aspxp" not sure how the extra "p" got in there or how that was giving me an error other than a 404... actually when i switched the app pool to classic I did get a 404 which led me to double check the url...

 

Anyway its fixed, sorrty to waste your time,

 

Zack

You must sign in to post in the forums. This thread is closed to new posts.