php中的会话销毁 [英] session destroy in php

查看:29
本文介绍了php中的会话销毁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 logout.php 页面中销毁我的会话

I want to destroy my session in logout.php page

<?php
  session_destroy();   
  unset($_SESSION["admin"]);
  $target = "admin.php";
  echo $_SESSION["admin"];
?>

因此会话正在破坏页面,但这并没有破坏整个应用程序的会话.

hence the session is destroying for the page but this is not destroying the session for the entire application.

如何帮助我?

推荐答案

在销毁会话之前忘记启动会话

You forget to start session before destroy it

试试这个

<?php 
session_start();
session_destroy(); 
?>

这篇关于php中的会话销毁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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