草庐IT

current_session_context_class

全部标签

PHP 设计模式 : Are private constructors bad for classes that you will let others to extend?

我有一个名为ContentAbstract的抽象类,它看起来像这样abstractclassContentAbstract{protectedstatic$type;protected$id;protected$title;protected$description;protected$page;protected$section;...function__construct($id=NULL,Page$page=NULL,Section$section=NULL){if($id!=NULL){$data=get_data_from_content_table_by_id($id);i

PHP session 在 htaccess 重定向条件下消失 - 仅在 Chrome 中

我的项目卡在这个问题上。我的htaccess中有这段代码来实现平面url系统Options+FollowSymlinksRewriteEngineonRewriteBase/RewriteCond%{REQUEST_FILENAME}!-fRewriteCond%{REQUEST_FILENAME}!-dRewriteCond%{REQUEST_URI}!^/page.phpRewriteRule(.*)page.php?pid=$1[QSA]虽然存在此代码,但我无法访问在任何其他页面上的一个页面上创建的session变量。即使页面是不经过重定向的静态.php页面,session也会消

php - pear HTML_QuickForm2 : How to get the saved session container back in form

我正在使用Controller制作多页表单。我正在将已提交和未提交的申请数据保存到数据库字段:$serialized_data=$oCon->dbConn->real_escape_string(serialize($ctrl->getSessionContainer()));$oCon->dbConn->query("INSERTINTOform_dataSET(data)VALUES('".$serialized_data."')");这工作正常,但我如何将保存的对象返回到未完成条目的session中?使用getValue()和将值保存到数据库字段时,仅取回值有效$ctrl->ad

php - session_set_save_handler 并写在 php 5.4.12 上

我正在使用session_set_save_handler()将session保存到数据库。从phpv.5.3移动到v.5.4之后,根本没有调用write()函数;无论是在调用session_write_close()函数时,还是在脚本终止时(它之前工作正常并且没有对代码进行任何更改)。read()、open()和close()函数仍然像往常一样被调用。我知道php5.4中有一些与session_set_save_handler()机制相关的变化。有没有人有类似的问题或知道发生了什么变化?classsession{private$table_name;function__constru

php - stream_context_set_params 与 stream_context_set_option

文档怎么说通过阅读php.net,在我看来,stream_context_set_params几乎与stream_context_set_option做同样的事情。即。http://www.php.net/manual/en/function.stream-context-set-params.phpboolstream_context_set_params(resource$stream_or_context,array$params)http://www.php.net/manual/en/function.stream-context-set-option.phpboolstre

ipad - Symfony session 变量在 ipad 中丢失

我正在开发一个symfony应用程序。它适用于所有浏览器,甚至适用于Macsafari。这些问题仅存在于ipad中。我的session变量很少会在其他页面中丢失。例如:我将session设置为:$this->getUser()->setAttribute('domainname',$this->domain);可以通过以下方式在每个浏览器的其他页面中检索此值:$this->domain=$this->getUser()->getAttribute('domainname');但在ipad设备(safari)中,我的变量没有检索。 最佳答案

php - session 没有破坏?

每当我尝试用不同的用户登录时,我发现用户名没有改变,这意味着$_SESSION['username']也没有改变,所以我的logout.php脚本有什么问题? 最佳答案 您还需要删除sessioncookie,像这样,fromthereference.另一个很好的引用,PHPSessionIntroductionGeorgeBrighton在评论中提到。 关于php-session没有破坏?,我们在StackOverflow上找到一个类似的问题: https:

session-variables - PHP session 在 Yahoo API 调用后过期?

在我的网站上,我正在构建YahooAPI应用程序。当我们从我们的应用程序访问YahooAPI时,Yahoo向我们的域返回成功响应。但是我的自定义session值已过期。我不知道原因。任何帮助我的赞赏。 最佳答案 在没有看到任何代码的情况下,我不得不推测您的$_SESSION['?']要么未设置:unset($_SESSION['?']);或正在销毁:session_destroy();在您的应用程序中的某处。检查您是否没有在您的应用程序中执行这些操作。 关于session-variabl

php oop 编程 : building a class

我正在考虑建立我的第一个真正的类(class),我玩过点点滴滴,但现在是真正尝试的时候了:)我想要做的是有一个表单类来处理我所有的表单提交,检查输入的数据并返回错误消息或成功消息。这是我的一个表格,(我在一页上有5个)BusinessSectordatabase->query("SELECT*FROMtbl_sectors");while($row=$user->database->fetchArray($query)){$id=$row['sectorID'];$dept=$row['sectorName'];echo"$dept";}?>Locationdatabase->quer

php - 使用 PHPUnit : Problems with Memcache sessions 测试 Magento

我们正在使用EcomDev包来测试我们的Magento商店,其中一项默认测试引起了轩然大波:运行phpunit返回:5)EcomDev_PHPUnitTest_Test_Helper_Customer::testCustomerSessionwithdataset"jane_doe"(2)Exception:Warning:session_module_name():Asessionisactive.Youcannotchangethesessionmodule'sinisettingsatthistimein/var/www/htdocs/app/code/core/Mage/Cor