title: Runtime Error using Redis Cache Session State Provider
body: <p>So I have an MVC application in which I am trying to use Azure's Redis Cache for my Session State Provider.  With everything coded and configured and all, when I publish it, the index page loads fine.  The only button to hit is 'Next', which is supposed to add a session state variable with a value, and then move on to the appropriate page.  But when I click 'Next' I get a runtime error.  If I simply comment out the sessionState block in Web.config and publish it like that, I can move on to the 'next' page just fine.  So I'm wondering what is wrong with my use of the provider and why it's not working?</p>
  
  <p>Web.Config block:</p>
  
  <pre><code>  &lt;system.web&gt;
      &lt;compilation debug="false" targetFramework="4.5.2" /&gt;
      &lt;httpRuntime targetFramework="4.5.2" /&gt;
    &lt;sessionState mode="Custom" customProvider="MySessionStateStore"&gt;
        &lt;providers&gt;
            &lt;add 
              type="Microsoft.Web.Redis.RedisSessionStateProvider"
              name="MySessionStateStore" 
              host = "[Host name from Azure]"
              port = "[Port # from Azure]"
              accessKey = "[Key from Azure]"
              ssl = "false"
              throwOnError = "true"
              retryTimeoutInMilliseconds = "5000"
              databaseId = "0"
              applicationName = ""
              connectionTimeoutInMilliseconds = "5000"
              operationTimeoutInMilliseconds = "1000"
            /&gt;
        &lt;/providers&gt;
      &lt;/sessionState&gt;
    &lt;/system.web&gt;
  </code></pre>
  
  <p>POST function when I hit the 'Next' button:</p>
  
  <pre><code>&lt;HttpPost()&gt;
  &lt;ValidateAntiForgeryToken()&gt;
  Async Function Index(ByVal obj As Type) As Task(Of ActionResult)
      If ModelState.IsValid Then
          Session("VarName") = obj
          Return RedirectToAction("nextPage", "[controller]")
      End If
      Return View()
  End Function
  </code></pre>
  
  <p>Note I am not using any cookies, nor am I trying to use the Redis Cache for anything else.  The non-SSL port IS Enabled in Azure (yes, bad, I know - that will change).</p>
  
  <p>I hope that's enough to go on to be able to help - if not, let me know.  Thank you!</p>