title: How to Set Sliding Expiration in my MVC app that uses STS (WIF) for authentication
body: <p>We are developing an MVC app using STS.  We used the WIF tools to create a simple STS app for development.</p>
  
  <p>I would like to be able to set a sliding expiration in my token (in the RP).  </p>
  
  <p>I see code <a href="http://social.msdn.microsoft.com/Forums/en/Geneva/thread/a048694c-3548-4b4d-9bb3-0589c888fd02" rel="nofollow">like here</a>.</p>
  
  <p>Unfortunately, this is the event handler and the example, while helpful, doesn't show how to implement the handler!</p>
  
  <p>In my global.asax, Application_Start() I have:</p>
  
  <pre><code>sam = new SessionAuthenticationModule();
          sam.SessionSecurityTokenReceived += 
              new EventHandler&lt;SessionSecurityTokenReceivedEventArgs&gt;(sam_SessionSecurityTokenReceived);
  </code></pre>
  
  <p>(sam is defined with a class scope.)</p>
  
  <p>I'm not sure if this is correct.  I do not know how to verify if the event was ever called because of debugging issues in global.asax.  </p>
  
  <p>Is there a more complete example somewhere of how to trap this event?  Am I going about it the right way?</p>
  
  <p>TIA!  I appreciate the help!
  Rich</p>
  
  <p>Edit - well, I know that the event is not getting called because I put divide by zero code in the handler and the app did not throw an exception.  I logged in thru my STS, so any token recieved event should have been fired.</p>
  
  <p>Any help on how to do this would be greatly appreciated.  thanks!</p>