5

I have two projects in the same server, their settings conflict in the "session.auto_start", related post. Can I have the session.auto_start "ON" despite the other project contains codes such as session_start()?

4 Answers 4

9

If you're using apache, and have the right Options, you can enable session.auto_start with a .htaccess file containing this line: php_flag session.auto_start 1

Or you might be able to put it in your global apache config in that tag.

Sign up to request clarification or add additional context in comments.

Comments

5

Do you need to independent sessions per user? I imagine you could just have one script check if a session already exists, like:

if(!($_SESSION)) {
    session_start();
}

Comments

3

If a session is already started. Then you will get an E_NOTICE error. session_start() docs.

Comments

0

I think you have conflict not because of "session.auto_start" you just need to set individual session_name for each project.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.