php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63251 yaf session功能增强
Submitted: 2012-10-10 06:34 UTC Modified: 2017-10-24 08:00 UTC
Votes:3
Avg. Score:3.7 ± 0.9
Reproduced:0 of 0 (0.0%)
From: vipcenter at vip dot qq dot com Assigned:
Status: Open Package: yaf (PECL)
PHP Version: 5.3.17 OS: *
Private report: No CVE-ID: None
 [2012-10-10 06:34 UTC] vipcenter at vip dot qq dot com
Description:
------------
一:建议增加:设置和获取session_id的方法!如:
Session::getInstance()->id('qtvv60cui9c22qlk2fqr0na1d1');
如果不传参则返回当前使用的session_id

二:建议增加对多维数组的良好支持,比如说在原生PHP里面设置多维数组:
$_SESSION['account']['uid']='123';
$_SESSION['account']['name']='cyrus';
$_SESSION['account']['email']='vipcenter@vip.qq.com';

要删除整个account则unset($_SESSION['account']);即可,删除单独的uid则
unset($_SESSION['account']['uid']);即可

在yaf里面设置多维数组和删除整个account没有什么问题,如下所示:
Session-
>set('account'=>array('uid'=>123,'name'=>cyrus,'email'=>'vipcenter@vip.qq.com'))
;
删除整个account:Session->del('account');

但是加入要删除单独的uid则会很不方便,需要进行整个account重新赋值才能达到单独删除uid的效
果,如下所示:
Session->set('account'=>array('name'=>cyrus,'email'=>'vipcenter@vip.qq.com'));
这个时候uid被删除,虽然功能可以达到,但是却很不方便,建议增加如下方法:
Session->del('account:uid');删除当个key的值!若能支持多级则更好,如:
Session->del('cms:account:uid');

三:增加 session_destroy();的实现:如:
Session->destroy();


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-10 07:34 UTC] laruence@php.net
assign to myself
 [2012-10-10 07:34 UTC] laruence@php.net
-Assigned To: +Assigned To: laruence
 [2017-10-24 08:00 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: laruence +Assigned To:
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC