Tuesday, May 27, 2008

want to use Session Variables in Sharepoint?

SharePoint by default does not use session state. You need to explicitly change it in the Web.Config file of your sharepoint web application
<httpmodules>
<clear>
<add type="System.Web.Caching.OutputCacheModule" name="OutputCache">
<add type="System.Web.Security.WindowsAuthenticationModule" name="WindowsAuthentication">
<add type="System.Web.SessionState.SessionStateModule" name="Session">
</httpmodules>

and also

<pages enablesessionstate="true" enableviewstate="true" enableviewstatemac="true" validaterequest="false">

1 comment:

jeymalraj said...

Hi Shafeer,
i tried using session variables the way you told but am not able to pass session value to another page.Is there any workaround for that??