We help IT Professionals succeed at work.

session_status

APD Toronto
APD Toronto asked
on
Hi Experts,

What are the corresponding values for session_status()?

When I echo it I get a 2

Thanks
Comment
Watch Question

Most Valuable Expert 2018
Distinguished Expert 2019
Commented:
These are the meanings of the return values:

PHP_SESSION_DISABLED = 0
PHP_SESSION_NONE = 1
PHP_SESSION_ACTIVE = 2
Most Valuable Expert 2011
Top Expert 2016

Commented:
Assume you're talking about this... http://php.net/manual/en/function.session-status.php
Most Valuable Expert 2011
Top Expert 2016

Commented:
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!
APD TorontoSoftware Developer

Author

Commented:
Thanks Ray!