PHP: session.auto_start

I have two projects on one server, their settings conflict with the "session.auto_start" associated with it. Can I have session.auto_start "ON" even though the other project contains codes such as session_start ()?

+4
source share
4 answers

If you use apache and have the necessary parameters, you can include session.auto_start with a .htaccess file containing this line: php_flag session.auto_start 1

Or you can place it in your global apache configuration in this tag.

+8
source

Do you need independent sessions for each user? I assume you can just check the script to see if the session exists, for example:

if(!($_SESSION)) { session_start(); } 
+4
source

If the session is already running. Then you get an error E_NOTICE. session_start() docs.

+3
source

I think that you have a conflict not because of "session.auto_start", you just need to set an individual site_name for each project.

0
source

All Articles