如何在注销时销毁treeview的cookie? [英] How to destroy the cookie of treeview on logout?

查看:46
本文介绍了如何在注销时销毁treeview的cookie?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在treeview函数(treeview插件)中将选项persist设置为cookie.注销时如何销毁cookie?我尝试了unset($_COOKIE['rememberme']);,但是登录时菜单已恢复!

I set the option persist to cookie in my treeview function ( treeview plugin ). How to destroy the cookie when logging out ? I tried unset($_COOKIE['rememberme']); but the menu is restored when logging !

推荐答案

您可以使用以下javascript设置cookie的过期日期,使其无法访问.

You can use the following javascript to set the exipration date of the cookie well into the past, thereby making it inaccessible.

document.cookie = 'rememberme=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';

这篇关于如何在注销时销毁treeview的cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆