Sitecore 8.0 Session is not Initialized Exception

Coveo for Sitecore 4.1 (pre-July 2018)


In Sitecore 8.0, you get an unhandled exception when calling one of the following four pages:

  • https://<INSTANCE_HOSTNAME>/sitecore%20modules/Web/Coveo/OAuth/AuthorizationLinkCallback.aspx

  • https://<INSTANCE_HOSTNAME>/sitecore%20modules/Web/Coveo/CoveoDiagnosticPackage.aspx

  • https://<INSTANCE_HOSTNAME>/sitecore%20modules/Web/Coveo/Admin/CoveoDiagnosticPage.aspx

  • https://<INSTANCE_HOSTNAME>/sitecore%20modules/Web/Coveo/Admin/SwitchToExpandedPermissions.aspx

The Exception Details state System.InvalidOperationException: session is not initialized.


A tag to prevent these pages from logging entries in xDB isn’t recognized.


There are two solutions. You can edit the four files which contain the unrecognized tag or upgrade Coveo for Sitecore.

Removing the Unrecognized Tag from the Files

  1. Open all four files in a text editor and remove the EnableSessionState="false" tag.

    For example, in the <SITECORE_INSTANCE_ROOT>\Website\sitecore modules\Web\Coveo\OAuth\AuthorizationLinkCallback.aspx file, locate the following line:

     <%@ Language="C#" Inherits="Coveo.SearchProvider.Applications.OAuth.AuthorizationLinkCallback" CodeBehind="AuthorizationLinkCallback.aspx.cs" EnableSessionState="false" AutoEventWireup="True" %>
  2. Edit the line so it reads:

     <%@ Language="C#" Inherits="Coveo.SearchProvider.Applications.OAuth.AuthorizationLinkCallback" CodeBehind="AuthorizationLinkCallback.aspx.cs" AutoEventWireup="True" %>
  3. Save your changes.

Upgrading Coveo for Sitecore

As of the July 2018 version of Coveo for Sitecore 4.1, the issue is fixed.