5

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.

Nikola K.
  • 7,093
  • 13
  • 31
  • 39
user1453094
  • 373
  • 2
  • 7
  • 13

2 Answers2

6

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

Nikola K.
  • 7,093
  • 13
  • 31
  • 39
Yousha Aleayoub
  • 4,532
  • 4
  • 53
  • 64
2

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

php_flag session.auto_start 0

in your .htaccess file

Picard
  • 3,745
  • 3
  • 41
  • 50