Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Custom SharePoint Site with AAM URL giving Session error.

Posted on 2013-05-10
5
Medium Priority
?
792 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 9

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

610 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