4
votes

How can I fix this?

Warning: ini_set() [function.ini-set]: A session is active. You cannot change the session module's ini settings at this time in C:\xampp\htdocs******.php on line 3

I already tried using session_destroy(); but I still get the error.

Thanks.

2
Have you tried changing the parameters beforehand?mario
@Gumbo ini_set('session.cookie_httponly', true);user1453094
Well, change it before starting the session.Gumbo
have you done a phpinfo() to see if your config has session.auto_start set on?TerryE
I have the same sporadic random error with my custom session provider. I have no idea what it could be.dAm2K

2 Answers

6
votes

use session_start(); after ini_set or @ sign before ini_set: @ini_set

2
votes

if you server is configured to auto start sessions, you can try also:

php_flag session.auto_start 0

in your .htaccess file