session_status

Hi Experts,

What are the corresponding values for session_status()?

When I echo it I get a 2

Thanks
APD TorontoAsked:
Who is Participating?
 
Chris StanyonCommented:
These are the meanings of the return values:

PHP_SESSION_DISABLED = 0
PHP_SESSION_NONE = 1
PHP_SESSION_ACTIVE = 2
0
 
Ray PaseurCommented:
Assume you're talking about this... http://php.net/manual/en/function.session-status.php
0
 
Ray PaseurCommented:
You can find these things out in the online man pages (sometimes) or you can force PHP to tell you with something like this:
http://iconoun.com/demo/temp_apd_toronto.php

<?php // demo/temp_apd_toronto.php

/**
 * See http://www.experts-exchange.com/Programming/Languages/Scripting/PHP/Q_28624598.html
 */
error_reporting(E_ALL);

// NOT SURE IF THIS IS NEEDED - TRY WITHOUT IT
session_start();


// MAKE THE OUTPUT EASY TO READ
echo '<pre>';

echo PHP_EOL . "PHP_SESSION_DISABLED "; var_dump(PHP_SESSION_DISABLED);
echo PHP_EOL . "PHP_SESSION_NONE ";     var_dump(PHP_SESSION_NONE);
echo PHP_EOL . "PHP_SESSION_ACTIVE ";   var_dump(PHP_SESSION_ACTIVE);

Open in new window

Be aware that PHP will set values identical to these values in other constants.  It's wise to use only the named constants, since their definition values are not guaranteed.  In other words, don't ask this question!
0
 
APD TorontoAuthor Commented:
Thanks Ray!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.