English 中文(简体)
结束一届会议的最佳途径是什么? [复制]
原标题:What is the best way to end a session? [duplicate]
  • 时间:2011-09-30 15:25:02
  •  标签:
  • php
  • session
This question already has answers here:
Closed 11 years ago.

Possible Duplicate:
How do I kill a PHP session?

在结束届会时,会议“建议”应销毁本届会议和该届会议所登记的变量。 但是,我看到,在摧毁本届会议之前,许多法典将所有已登记的届会变量都排除在外。 请谁知道,什么是最佳做法?

最佳回答

session_destroy 删除了所有届会数据,因此在next请求中获得了数据。 但是,如果您的申请依据的是<代码>_SESSION阵列中的具体价值,则可能以错误的方式行事。 但是,你不需要打破每届会议的变动,你可以这样结束届会:

$_SESSION = array();    
session_destroy();
问题回答
    $_SESSION = array();
    session_destroy();
    setcookie( PHPSESSID ,   , time()-3600, / ,   , 0, 0);

http://php.net/session_destroy。

破坏本届会议将打破所有变量。 我不知道有任何理由在销毁之前揭开它们。 但是,MAY希望揭开这些变量,但KEEP希望本届会议。 可以通过召集会议来做到这一点。





相关问题
why the session in iis automatically log out?

I used iis6, and when i called a function Directory.delete(), the all the session relate this website will be logged out. and i debugged the website, i found no exception. any one have ideas on this ? ...

Check session from a view in CodeIgniter

What is the best way to check session from a view in CodeIgniter, it shows no way in their user guide, otherwise I will have to make two views on everything, which is kinda weird...still a newbie to ...

Can I get the size of a Session object in bytes in c#?

Is it possible to get the size(in bytes) of a Session object after storing something such as a datatable inside it? I want to get the size of a particular Session object, such as Session["table1"], ...

提供严格分类的出席会议物体

提供严格分类的与会机会的最佳方式是什么? 我正计划转而选择矩阵,这正在促使汇编者抱怨我的幻觉方案拟订方法......

PHP Session is not destroying after user logout

I m trying to create an authentication mechanism for my PHP Application and I m having difficulty destroying the session. I ve tried unsetting the authentication token which was previously set within ...

热门标签