come on guys, I know where you are all coming from but sometimes, I see a question asked like this all the time and the reply is always the same 'SHOULD' you be doing this?
if it can be done tell us 'HOW' , not the moralities of whether it should or shouldn't be acording to the gospel of luke!
I had to do this feature for my members area, I needed to log them out when the browser was closed regardless, and was finding onunload was no good to open a window because popup blockers kept blocking the window.
I used to force out reg keys to all members that allowed me to open the browser in full screen so there was no [x] to click and so they had to click the logout button, but this sometimes caused problems when third party sites that made up part of the members area
They had programmers who didn't use the window.open command with attributes, and so the browser defaulted to the last know window type - which was full screen and left the user with a PDF in full screen, no menu options or toolbar and no way to close it - not good.
I actually ended up utilising AJAX with the onunload, firing an AJAX request to log them out and throwing up an alert box telling them a popup blocker had blocked the logout window, giving the ajax time to run before the window completely closed when the ok button was pressed.
This works well and resolved my issue, but if there was a way to ensure the logout code ran and diplayed the logout succesfull message, i'd very much appreciate someone sharing the answer.
I've seen sites, where I have closed the window but it just seems to redirect to another site instead of closing and so beats the popup blockers, I just don't know how to do it.
It's not always whether you should or shouldn't do something, it's what you do with it that counts.
If I force a new page to open regardless of popup blockers, to ensure that the logout is successfull , that is not a bad thing to do!
If my boss tells me that I must enforce EVERY member whether they like it or not to see an advert, then it MUST be done. If they tell me to force everyone to complete a survey, then it must be done.
The moralities of web standards is irrelevant, this is not a joe public site it is an industry B2B members compulsary under Financial Services Authority compliance website.
Standard web practices do not always function in a company intranet application environment.
well there's my 2p on the matter - lol
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.