Home  >  Article  >  Backend Development  >  session,autoload(),有关问题。寻高手赐教。

session,autoload(),有关问题。寻高手赐教。

WBOY
WBOYOriginal
2016-06-13 13:52:08759browse

session,__autoload(),问题。寻高手赐教。-。-
我开启了一个session以后,我想要设置session的有效时间,怎么设置!我改了PHP.ini配置文件里面的session.cache_expire = 1,没有实现... 修改了session.gc_maxlifetime=10,也没有得到预想的效果。求教 -。-!



还有。。。。。。。
php文件加载 __autoload($class_name){ 
}


我在第一个文件里面使用autoload()引入其他文件,在第二个文件开始也使用了该方法。然后我在3个文件里面对2个类进行实例化。 err:Cannot redeclare __autoload() (previously declared in C:\AppServ\www\test\autoload_test.php:1) in C:\AppServ\www\test\include1.php on line 4
简洁代码:
文件1:
function __autoload($class_name){
include $class_name.".php";
}
class include1{}
?>
文件2:
function __autoload($class_name){
include $class_name.".php";
}
class include2{}
?>
文件3:
include $class_name.".php";
}
$inculde1=new include1();
$inculde2=new include2();
?>
请指教.

------解决方案--------------------
第二个问题 你已经在第三个文件中声明了此函数,不用再别的地方重新成名了。
------解决方案--------------------
session_cache_expire(1);确保放在 session_start()之前

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn