gpt4 book ai didi

php - 如何按名称删除 session

转载 作者:行者123 更新时间:2023-12-04 15:44:28 24 4
gpt4 key购买 nike

如何通过名称删除 php session 例如我有 session['sec']session['page'] 我需要删除 session['page'] 而不删除 session ['sec']

最佳答案

// for a single variable
unset($_SESSION['session_var']);

// destroy the Session, not just the data stored!
session_destroy();

// delete the session contents, but keep the session_id and name:
session_unset();

关于php - 如何按名称删除 session ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10703721/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com