Home>Article>Web Front-end> How to delete session in javascript
Javascript method to delete session: [setTimeout(function() { sessionStorage.clear(); window.parent.location.reload();var index =...].
The operating environment of this article: windows10 system, javascript 1.8.5, thinkpad t480 computer.
javascript closes the current page and clears the session.
Page:
js关闭当前页清除session
layui
//设定时间一秒后触发 setTimeout(function() { sessionStorage.clear(); window.parent.location.reload();//刷新父页面 var index = parent.layer.getFrameIndex(window.name); parent.layer.close(index); //关闭当前页 }, 1000);
Recommended learning:javascript video tutorial
The above is the detailed content of How to delete session in javascript. For more information, please follow other related articles on the PHP Chinese website!