This is a really strange problem, that appears to be somewhat intermittent (although it has started consistently occurring now - possibly due to a Windows Update?).
My code has previously worked fine in IE7, and continues to work in Firefox, Chrome, and seemingly any other browser but IE8.
I'm setting some session data and then passing the user to a payment gateway (Protx / Sage, if that makes any difference), which on return needs to reference my session data. But my session data disappears. I'm not doing anything fancy with the payment gateway display - no iframes, just a link that takes the user to the payment page, in the same browser window.
Having done some reading, I've tried adding the following to force compatibility mode in my page (as apparently this can cause IE8 to lose session data):
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
This had no effect (but then, as far as I can tell, the payment page is not forcing compatibility mode).
There seem to be quite a few people saying that iframes cause this behaviour, but again, no iframes are used.
Considering how persistent session data is in IE8 - unlike IE7, and other browsers, when a new instance of the browser is initiated, any session in another instance of the browser are accessible - I'm struggling to see where and how my session data is being lost.