Hi, I have customized the SharePoint 2010 site and using c# code for session state code like:
Session ["test"].
That site is working fine with above code when using default SharePoint URL i.e.
http://myworld:2456
But when using Intranet url i.e.
http://travel.space.com then it’s giving error where using session:
Error:
“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.SessionStateMod
ule or a custom session state module is included in the <configuration>\<system.we
b>\<httpMo
dules> section in the application configuration.”
--------------------------
----------
----------
-------
For Intranet url I have just made an entry in DNS
http://travel.space.com with SharePoint server IP and in SharePoint Central Administration site in alternate access mapping made and entry for Intranet zone with
http://travel.space.com. Site is opening successfully but that session code using for some action is not working.
Kindly guide.
Remove the AAM to the external URL.
Extend the web application to your external URL.
Create a new AAM to your external URL under the Internet zone.
Make the neccesary modifications in the web.config for your extended URL (make sure you use the object model to make your web.config mods as sharepoint health analyzer can somtimes go back and revert web.config changes!)
My guess would be that your code is failing externally because it is referencing the internal URL when the internal URL isnt accessable from the outside - this should resolve that issue