See edits to the original question; basically, PHP 5.4 and above now has a function called session_status()
to solve this problem!
“Expose session status via new function, session_status” (SVN Revision 315745)
If you need this functionality in a pre-PHP 5.4 version, see hakre’s answer.