jsp 질문 드립니다.

lalupo20의 이미지

<script>
function closePage(){
	window.location='logout_ok.jsp';
	return "종료하시면 로그아웃 됩니다.";
}
</script>

<body onbeforeunload="return closePage()">
<h1><p align="center"><a href="Main.jsp" style="text-decoration:none">adfd</a></p></h1>
<div class="container">
	<div class="topContainer">
		<table width="100%">
		<tr>
			<td><jsp:include page="MenuForm.jsp" flush="false"/></td>
		</tr>
		</table>

웹브라우저를 종료하면 로그아웃 시키려고 합니다.

그런데 위와 같이 코드를 작성한 상황인데

ie에서는 작동하나 엣지나 크롬에서는 작동하지 않습니다.

다른 방법을 사용해야 하나요?

lalupo20의 이미지

고려하지 않는게 좋다는 이야기를 들었습니다.
다른 방법을 생각해봐야할거 같네요.