Session, autoload (), related issues. Learn from others.

Source: Internet
Author: User
Session ,__ autoload (), problem. Learn from others. -. -After I start a session, I want to set the validity period of the session. how can I set it! I changed the session. cache_expire = 1 in the PHP. ini configuration file, but the session is not implemented. Learn from others. -. -
After I start a session, I want to set the validity period of the session. how can I set it! I changed session. cache_expire = 1 in the PHP. ini configuration file, but the session. gc_maxlifetime = 10 was not implemented. Ask for advice -. -!



And .......
Php file loading _ autoload ($ class_name ){
}


I used autoload () in the first file to introduce other files. this method is also used in the second file. Then I instantiate two classes in three files. Err: Cannot redeclare _ autoload () (previusly declared in C: \ AppServ \ www \ test \ autoload_test.php: 1) in C: \ AppServ \ www \ test \ include1.php on line 4
Concise Code:
File 1:
Function _ autoload ($ class_name ){
Include $ class_name. ". php ";
}
Class include1 {}
?>
File 2:
Function _ autoload ($ class_name ){
Include $ class_name. ". php ";
}
Class include2 {}
?>
File 3:
Include $ class_name. ". php ";
}
$ Inculde1 = new include1 ();
$ Inculde2 = new include2 ();
?>
Please advise.

------ Solution --------------------
The second problem is that you have already declared this function in the third file, so you no longer need to become famous again.
------ Solution --------------------
Session_cache_expire (1); make sure it is placed before session_start ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.