Home>Article>Web Front-end> How to delete session in javascript

How to delete session in javascript

王林
王林 Original
2021-11-10 15:54:16 6180browse

Javascript method to delete session: [setTimeout(function() { sessionStorage.clear(); window.parent.location.reload();var index =...].

How to delete session in javascript

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn