Expiring an IE session using WatiN
- by Steve Wilkes
I'm trying to write an acceptance test using WatiN which checks that a user is redirected to the login page if they navigate to a page after their session times out. I'm using WatiN's IE class for the browser, and trying the following:
// 1. Login
// 2. Do this:
Browser.ClearCookies();
Browser.ClearCache();
// 3. Navigate to a different page
But the user is always still logged in. Other info:
I'm running the test through the NUnit GUI running as an administrator
It's an ASP.NET MVC 3 site, using forms authentication and in-process session state
I'm using IE9.
If I manually clear all cookies in Chrome, the user is logged out
If I manually clear all cookies in IE the user stays logged in
If I call Browser.Eval("alert(document.cookie)"); in IE it alerts an empty string
Given the above, I'm assuming this is a quirk with IE; any ideas how I can work around it?