function _open should return true to avoid this error. It can not be null or empty whatever we use either database or file. When we use database to store session data, we keep it blank or no Boolean return. that is the main reason for this error. class session_handler{
public function __construct()
{
session_set_save_handler(
array($this, "_open"),
array($this, "_close"),
array($this, "_read"),
array($this, "_write"),
array($this, "_destroy"),
array($this, "_gc")
);
}
public function _open($savePath, $sessionId)
{
return true;
}
public function _close() { }
public function _read($id) { }
public function _write($id, $data) { }
public function _destroy($id) { }
public function _gc($max) { }}It is only for PHP 7. I do not know it is a bug or not. https://stackoverflow.com/questions/34125849/php-7-user-sessions-issue-failed-to-initialize-storage-module |
PHP 7 user sessions issue - Failed to initialize storage module
-
在Android library中不能使用switch-case语句访问资源ID的原因分析及解决方案
当我们在Android依赖库中使用switch-case语句访问资源ID时会报如下图所示的错误,报的错误是case分支后面跟的参数必须是常数,换句话说出现这个问题的原因是Android library中生成的R.java中的资源ID不是常数:
-
Android : Getting error “cannot resolve getSharedPreferences(java.lang.String, int)”
Android : Getting error “cannot resolve getSharedPreferences(java.lang.String, int)”
-
Maven之自定义archetype生成项目骨架(一)
使用过Maven的人都知道maven中有许多功能都是通过插件来提供的,今天我们来说一下其中的一个插件:maven-archetype-plugin
-
list All elements are null引起的异常,elementsnull
ArrayList允许添加null值,就容易造成了list内的对象转换出现java.lang.NullPointerException异常。
-
android Toast提示异常:java.lang.RuntimeException: Can't create handler inside thread that has not called
原来是在子线程弹Toast了, 切记,Toast只能在UI线程弹出,如果一定要在子线程弹,那么就通过 new Handler(Looper.getMainLooper()) 来弹
-
Android在thread中Toast不能显示问题解决
一般如果不是在主线程中又开启了新线程的话,一般都会碰到这个问题。 原因是在创建新线程的时候默认情况下不会去创建新的MessageQueue。
-
IntelliJ Idea解决Could not autowire. No beans of 'xxxx' type found的错误提示
在Idea的spring工程里,经常会遇到Could not autowire. No beans of 'xxxx' type found的错误提示。但程序的编译和运行都是没有问题的,这个错误提示并不会产生影响。但红色的错误提示在有些有强迫症的程序员眼里,多多少少有些不太舒服。
-
如何去除设置 location.hash 后的 # 号?
怎么去除location,中的hash
-
监听地址栏hash值的变化
用vue模仿原生,去监听hash变化来做些事情感觉不错,
-
implementation影响依赖的library,应该用compile
今天在library中引入了一些第三方jar包,通过implemention的方法,接头在主工程中找不到。