Mvc Online website has intermittent login request
<p>We have deployed a website online and logged in as a user, we see a request to login (intermittently and on random actions). This seems to happen when the action needs to be authorized according to the users role. It appears as if the system thinks that the user does not have the required role. This happens even when the user has the role required to access the action.</p>

<p>We cannot recreate this problem offline, even connecting to the online database with Visual Studio does not recreate the problem. Since this login request is also intermittent there is no consistent way to recreate the problem.</p>

<p><strong>This is how we have structured sections of the connection strings in our web.config file:</strong></p>

<pre><code>&lt;add name="DefaultConnection" connectionString="Data Source=xxxxxx,1444;Database=xxxxxx;Integrated Security=False;User Id=xxxxxxx;Password=xxxxxxxxxxxxxxx;" providerName="System.Data.SqlClient" /&gt;

&lt;remove name="LocalSqlServer" /&gt;
&lt;add name="LocalSqlServer" connectionString="Data Source=xxxxxxxxx,1444;Database=xxxxxx;Integrated Security=False;User Id=xxxxxxx;Password=xxxxxxx;" providerName="System.Data.SqlClient" /&gt;
</code></pre>

<p>Removing the LocalSqlServer section generates the following intermittent Exception:</p>

<p><a href="https://i.stack.imgur.com/5PhaU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5PhaU.png" alt="enter image description here"></a></p>

<p>This error also cannot be recreated offline connecting to the online database</p>