I want to store my session in session state service. I am following this site for setting up it.
But when I enable it, my site gives me 500 Internal Server Error. When I trace it I see below log:
<EventData>
<Data Name="ContextId">{80000319-0000-5A00-B63F-84710C7967BB}</Data>
<Data Name="ModuleName">IIS Web Core</Data>
<Data Name="Notification">1</Data>
<Data Name="HttpStatus">500</Data>
<Data Name="HttpReason">Internal Server Error</Data>
<Data Name="HttpSubStatus">19</Data>
<Data Name="ErrorCode">2147942583</Data>
<Data Name="ConfigExceptionInfo">\\?\C:\inetpub\wwwroot\wss\VirtualDirectories\demo.test80a73222a2-f9b6-4085-9f5b-509b8d04f213\web.config ( 680) :Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'Session'
</Data>
I have enabled session state as follow:
<pages enableSessionState="true" enableViewState="true" enableViewStateMac="true" validateRequest="false" clientIDMode="AutoID" pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" asyncTimeout="7">
And commented below line:
<!--<remove name="Session" /> -->
I have enabled third party authentication using Identity server, which adds below code in file:
<add name="SessionAuthentication" type="Microsoft.SharePoint.IdentityModel.SPSessionAuthenticationModule, Microsoft.SharePoint.IdentityModel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
Nothing added except that. Can someone help me understand what is wrong?