阮一峰的IT笔记:首页 -> 分类 -> PHP 查看所有文章:按分类 | 按月份

如何销毁一个session?

第一步,销毁session存在服务器端的数据。

session_destroy();

第二步,删除客户端的session cookie

setcookie(session_name(),'',time()-3600);

第三步,销毁全局变量$_SESSION

$_SESSION=array();

« PHP的错误处理 | 首页 | MySQL 笔记(I) »

About

This page contains a single entry from the blog posted on 2007年11月03日 01:23.

The previous post in this blog was PHP的错误处理.

The next post in this blog is MySQL 笔记(I).

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33

Post a comment