>> But after F5 (refresh, but not closing the browser) my session variable remains at 0 and I don't do the calcs. This means that the 'New Session' embed code is not triggered for an F5.
Correct. F5 is just a page refresh. It's definitely not a new session. A new request maybe, but not a new session.
>> this is understandable in that the implication is that F5 does not mean 'New Session' (but if I close the app, restart and hit F5 then it is a new session).
if you close the _server_ then all the server-side sessions are lost. So the next communication from the browser will indeed start a new session.
>> So, to get my logic right I need to understand what F5 means in terms of program execution and whether I can trap it somewhere so that I can reset my session variable.
you can't tell the difference between someone pressing F5, or just navigating to the page.
If you want to do something when the page is refreshed, then, um, do it in that procedure.
cheers
Bruce