Can't use ini_set because session is active

user1453094 picture user1453094 · Jul 8, 2012 · Viewed 13.4k times · Source

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.

Answer

Yousha Aleayoub picture Yousha Aleayoub · Jul 20, 2012

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