Home > Web Front-end > JS Tutorial > body text

How to delete session in javascript

王林
Release: 2021-11-10 15:54:16
original
6010 people have browsed it

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
  




Copy after login

layui

//设定时间一秒后触发
  setTimeout(function() {
  		sessionStorage.clear();  		
  		window.parent.location.reload();//刷新父页面
  		var index = parent.layer.getFrameIndex(window.name);
  		parent.layer.close(index); //关闭当前页 
  	}, 1000);
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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 [email protected]
Latest issues
Popular Tutorials
More>
Latest downloads
More>
web effects
Website source code
Website materials
Front end template
About us Disclaimer Sitemap
PHP Chinese website:Public welfare online PHP training,Help PHP learners grow quickly!