Hi John,
I tried to replicate this on my machine debugging under IIS 7 but I could not.
-
Created a folder mobile in the mojoPortal.Web project
-
added a Default.aspx page to the fodler from VS 2010 with text hello mobile
-
added your code to the top of page load in Default.aspx.cs in the root of the web
-
changed the logic to !Request.Browser.IsMobileDevice since I'm debugging on a desktop not a mobile device
-
set a break point on the first line of your code and launched the debugger
The break point was hit only 1 time indicating the event only fired 1 time, it set the cookie and redirected as expected and I saw the hello mobile message.
As you know, I don't recommend putting custom code into existing mojoPortal code. Something like this could be done using a custom httpmodule and some logic to inspect the url along with the cookie logic to determine if it should redirect or not.
Best,
Joe