Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Session callback expects true/false return value

Tags:

php

My php script, sometimes, give me the following error:

    Warning: session_start(): Session callback expects true/false return 
value in C:\xampp\htdocs\verifica.php on line 10

verifica.php line 10:

if (session_status() == PHP_SESSION_NONE) {
    session_start(); //this is line 10
}

what is wrong? why I have this error? this only shows when it wants, not always...

like image 438
RGS Avatar asked Aug 06 '26 21:08

RGS


1 Answers

I've had the same problem when code used session_set_save_handler with object and I've fixed the issue by returning boolean from _destroy method, I think that all handlers need to return true/false.

like image 196
jcubic Avatar answered Aug 08 '26 11:08

jcubic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!