var btn = document.getelementByid("<%LogoutButton%">
btn.click();
This does initiate but by the time Click is called, the form is already closed and thus the event is not executed. Thus, it's not working. Try to put a delay such that onclick event can occur and see. Though, I would like to inform, handling browser close is not easy and full proof.
Also, instead of calling click, try to call a XMLHttpRequest and try to signout.
BTW, session and forms authentication - Both are different.