Changes between Version 6 and Version 7 of WikiStart
- Timestamp:
- 01/27/14 11:55:44 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiStart
v6 v7 161 161 Here we use the default ASP.NET session id which is stored in cookies to ensure that users can't inadvertently leak their private URL. 162 162 163 == Page.OnPreInit==163 == {{{Page.OnPreInit}} == 164 164 165 The last step is to add continuation validation at some point in the page lifecycle. Clavis checks that all the protected parameters hash to the same HMAC value as specified in the URL. If they don't, an exception was thrown indicating that a protected parameter was incorrectly changed. I typically do this in Page.OnPreInit :165 The last step is to add continuation validation at some point in the page lifecycle. Clavis checks that all the protected parameters hash to the same HMAC value as specified in the URL. If they don't, an exception was thrown indicating that a protected parameter was incorrectly changed. I typically do this in Page.OnPreInit in a custom System.Web.Page base class: 166 166 {{{ 167 167 protected override void OnPreInit(EventArgs e) … … 171 171 } 172 172 }}} 173 As you can see, Clavis is a drop-in library that doesn't affect existing code. You can incrementally deploy it by converting one page at a time to continuations, and these pages will validate automatically as soon as they implement some IContinuation<...> type. You don't need to perform validation as above of course, you just need to place a call to {{{Continuation.Validate()}}} somewhere in the page lifecycle, although on init or pre-init is preferable so you don't waste time parsing parameters that won't validate anyway.