title: W.I.F.: Setting IsSessionMode to true, can't seem to make it happen
body: <p>We are having problems with Safari(and Opera) and from what I have read the FedAuth cookies are just too big.</p>
  <p>There is an &quot;neat trick&quot; to fix this:
  &quot;WIF RTM added a property to the SessionAuthenticationModule, IsSessionMode. When flipped to true, IsSessionMode has the effect of ensuring that the SessionSecurityToken remains in the cache for the whole duration of the session and generating a cookie which contains just a session identifier rather than the content of the session itself.&quot;</p>
  <p>I have this code in global.asax:</p>
  <pre><code>void WSFederationAuthenticationModule_SessionSecurityTokenCreated(object sender, Microsoft.IdentityModel.Web.SessionSecurityTokenCreatedEventArgs e)
  {
      FederatedAuthentication.SessionAuthenticationModule.IsSessionMode = true;
  }
  </code></pre>
  <p>The Problem , &quot;FederatedAuthentication.SessionAuthenticationModule.IsSessionMode = true&quot; never runs ... why?</p>
  <hr />
  <p>Is it related to the &quot;PassiveSignInControl&quot; to set IsSessionMode to true?</p>
  <p><a href="http://social.msdn.microsoft.com/Forums/en/Geneva/thread/ea00ec3f-ebdf-427c-929f-d4a196650552" rel="nofollow noreferrer">MSDN Post</a></p>
  <p><a href="http://blogs.msdn.com/b/vbertocci/archive/2010/05/26/your-fedauth-cookies-on-a-diet-issessionmode-true.aspx" rel="nofollow noreferrer">your-fedauth-cookies-on-a-diet-issessionmode-true.aspx
  </a></p>
  <p>From the book &quot;Programming Windows® Identity Foundation&quot;:</p>
  <blockquote>
  <p>&quot;An interesting property of the SAM is IsSessionMode. When set to
  true, IsSessionMode has the effect of storing the bulk of the session
  on a server-side token cache instead of writing everything in the
  cookie. The cookie itself will just contain a small context
  identifier, which will be used for retrieving the session on the
  server. Unfortunately, in this version of the92 Part II Windows
  Identity Foundation for Identity Developers product there is no way to
  set IsSessionMode from the configuration file. You can set it via a
  property of the PassiveSignInControl, or in the global.asax file as
  follows(same code as above)&quot;</p>
  </blockquote>