0

Trying to apply the configuration patch to update the shared session state to use mongo per doco below: https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/xdb/session_state/walkthrough_configuring_a_shared_session_state_database_using_the_mongodb_provider

However bit stuck with best way to patch it. One option is to delete the sharedSessionState node and add the mongo settings.

Any help will be good.

Marek Musielak
  • 26,832
  • 8
  • 72
  • 80
Nil Pun
  • 17,035
  • 39
  • 172
  • 294

1 Answers1

2

You don't need to remove existing <sharedSessionState> node. Just use the patch below:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <tracking>
      <sharedSessionState>
        <patch:attribute name="defaultProvider">mongo</patch:attribute>
        <providers>
             <add
                 name="mongo"
                 type="Sitecore.SessionProvider.MongoDB.MongoSessionStateProvider,
                 Sitecore.SessionProvider.MongoDB"
                 connectionStringName="session"
                 pollingInterval="2"
                 compression="true"
                 sessionType="shared"/>
        </providers>
      </sharedSessionState>
    </tracking>
  </sitecore>
</configuration>

Just remember to add it after Sitecore.Analytics.Tracking.config file.

Andrey Bobrov
  • 201
  • 1
  • 13
Marek Musielak
  • 26,832
  • 8
  • 72
  • 80
  • Thanks Marek. Is it ok to set this Mongo sharedsessionstate for both CMS and CD? Or should be only applied to CD? – Nil Pun May 29 '16 at 11:08
  • I'm not sure but it should be ok to use mongo on CM server as well. I don't see any reason why would it break anything. – Marek Musielak May 29 '16 at 15:18