Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a downside to session.auto_start in PHP?

Tags:

php

session

I usually end up adding session_start() to the top of every page on my PHP sites (or in a header file which is in turn included on every page). I recently discovered that you can have sessions start automatically by using the following setting in php.ini:

session.auto_start = 1

What are the potential downsides (if any) of using this setting?

like image 408
David Jones Avatar asked Jul 16 '12 05:07

David Jones


1 Answers

If you turn on session.auto_start then the only way to put objects into your sessions is to load its class definition using auto_prepend_file in which you load the class definition else you will have to serialize() your object and unserialize() it afterwards. See.

like image 96
Lion Avatar answered Oct 28 '22 19:10

Lion