?
Solved

Custom SharePoint Site with AAM URL giving Session error.

Posted on 2013-05-10
5
Medium Priority
?
788 Views
Last Modified: 2013-06-25
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.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> 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.
0
Comment
Question by:Minesh Shah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39155810
Hi,
it seems that you have a second web app connected to the same content database.
Please go to central admin and verify in "Manage web application" page, that you have not the two web apps from above.
0
 
LVL 5

Expert Comment

by:manojce
ID: 39160502
Hi,

As per given error you have to enable session state from your web config's page tage as per below.

Go to your sites' web.config file & open.
Then search for "<pages".
Now see then property "enablesessionstate" is true OR not.
If not then add this property to true. as per below code.

<pages enablesessionstate="true">
    <httpmodules>
        <add type="System.Web.SessionState.SessionStateModule" name="Session" />
    </httpmodules>

Open in new window


Let me know if you have any query.

Thanks,
0
 
LVL 10

Author Comment

by:Minesh Shah
ID: 39183846
Dear RainerJ,
http://travel.space.com is not a web application it is just a URL which I entered as an entry in DNS and then made and entry in SharePoint Central Administration in Alternet Access Mapping against SharePoint web application default URL http://myworld:2456 .
Means with the help of Alternet Access Mapping I can access content of http://myworld:2456 also by http://travel.space.com 
So site is opening via both URL only problem is with the session code.

Dear manojce:
I had already tried the :
<pages enablesessionstate="true"> <httpmodules> <add type="System.Web.SessionState.SessionStateModule" name="Session" /> </httpmodules>

But no luck.

is there any entry needs to be done in IIS?
0
 
LVL 8

Accepted Solution

by:
vaderj earned 2000 total points
ID: 39242587
You might try going a step further -
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
0
 
LVL 10

Author Closing Comment

by:Minesh Shah
ID: 39275431
tx
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question