I am facing a problem today with the phpCas library https://wiki.jasig.org/display/CASC/phpCAS.
Problem is the following, when I try to use some logout function, I got the message
Warning: session_destroy(): Trying to destroy uninitialized session
After giving a quick look into the phpCas's library code, I manage to figure out where the problem comes from, here is a snippet of a logout function :
session_write_close();
header('Location: '.$cas_url);
phpCAS::trace("Prepare redirect to : ".$cas_url);
session_unset();
session_destroy();
The problem there it seems is that session_write_close()
actually close the session then session_destroy()
can't work.
Tried to put the session_write_close()
in comment and worked like a charm but it leads to two questions :
Is the problem really coming from there? Or should it work?
If the problem do really come from there, why is it there and nobody complaining? Thought phpCas was a reknown library used by many.