Geeks With Blogs
Michael Van Cleave Traveling the technical world, learning the language

Of late I have been working with a forward thinking company that has been deploying Sharepoint 2007 to production and using it as its Intranet.

Last night we upgraded the production servers to the RTM version from B2TR.  Everything seemed to go great upgrading the servers but this implementation was a little different.  The company has about 14 web applications that need to be reference from the sharepoint portal and they all are classic ASP or ASP.NET 1.1 applications.  Still nothing strange there right?

We do the conversion and everything goes smooth. we install the virtual directories under the portal (sharepoint) web, and again everything seems to go smoothly.  Click through the pages that hit the external applications and we find that all of the ASP.NET 1.1 applications that utilize session state get a very interesting error:

Server Error in '/XXXXXXX' Application.

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.

So after hunting and hunting, a very sharp guy on the team finds that the Web.config in the virtual directory for Sharepoint (<drive>://inetpub/wwwroot/wss/virtualdirectories/80) has the <pages> entry defined as:

    <pages enableSessionState="false" enableViewState="true" enableViewStateMac="true" validateRequest="false" pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" asyncTimeout="7">

We flipped the enableSessionState flag to true and low and behold no more error.

This took us a while to find and I know if the individual that found it didn't by chance see it then we would still be looking for this fix.

So, if you seem to encounter this issue, try giving the enableSessionState bit a flip and see what happens.

Michael

Posted on Monday, December 11, 2006 1:02 PM | Back to top


Comments on this post: Running ASP.NET 1.1 Applications with Session under Sharepoint 2007

# session state accessed from a webpart
Requesting Gravatar...
when i tried to access the session variables from a webpart, i got the same error. I hav already tried the fix you described. it didn't work. any help?
Left by Jay on Mar 06, 2007 5:31 AM

# re: Running ASP.NET 1.1 Applications with Session under Sharepoint 2007
Requesting Gravatar...
The part that I described was for using session state in linked in ASP.NET 1.1 applications to sharepoint 2007.

In your case you want to be sure that session state is configured for Sharepoint in the Central Administration. That should work. Although, I have never tried to use session state from a web part.

hth

Michael
Left by Michael on Mar 06, 2007 10:25 AM

# re: Running ASP.NET 1.1 Applications with Session under Sharepoint 2007
Requesting Gravatar...
In our application we are using session variables. and we have given session timeout for 60 minutes but still we are getting "Object reference not set to an instance of an object" Error.


Can i get the solution for this?


And i want to know What is the maximum session expiry we can give in sharepoint 2007?
Left by shwetha on Jul 18, 2007 10:25 PM

# re: Running ASP.NET 1.1 Applications with Session under Sharepoint 2007
Requesting Gravatar...
Interesting. I am not quite sure why you would want to have a session stay open that long, but if that is necessary then that is okay too.

I think that the Object reference error you are getting may not be related to the session, and increasing the session timeout probably wouldn't fix it.

Is there any more event log errors or information you can supply that might make it a bit easier to point you in the right direction?

Michael
Left by Michael on Jul 18, 2007 10:31 PM

# re: Running ASP.NET 1.1 Applications with Session under Sharepoint 2007
Requesting Gravatar...
Hi there,
The timeout issue that I am trying to grapple with is the timeout not cutting in at all. You didn't encounter that after thinking you had it working? As a point of difference, we are using ASP.NET 2.0 controls within Sharepoint 2007 pages.
Left by Brian on Sep 30, 2007 5:56 PM

# re: Running ASP.NET 1.1 Applications with Session under Sharepoint 2007
Requesting Gravatar...
Hmmm.. What do you have the current session timeout set at? Also, check to be sure that the session timeout is not set in another competing web.config that might be overriding the session timeout for you web application.

Michael
Left by Michael on Sep 30, 2007 8:20 PM

# re: Running ASP.NET 1.1 Applications with Session under Sharepoint 2007
Requesting Gravatar...
Finally, an answer. Thanks for this post. ^_^
Left by greenspan on Dec 04, 2009 12:17 AM

# re: Running ASP.NET 1.1 Applications with Session under Sharepoint 2007
Requesting Gravatar...
Excelent, not only requiere modify the web.config of your application virtual directory for enable the sessions, also is required modify the web.config in <drive>://inetpub/wwwroot/wss/virtualdirectories/80, thank you
Left by Eric Reyes on Aug 31, 2010 11:12 AM

Your comment:
 (will show your gravatar)


Copyright © Michael Van Cleave | Powered by: GeeksWithBlogs.net | Join free