session bugfixes

This commit is contained in:
Joey Kimsey
2024-08-13 02:25:11 -04:00
parent 7228e530b8
commit 85ed1def88

View File

@ -21,6 +21,9 @@ class Session {
* @return {bool}
*/
public static function exists( $name ) {
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
if ( ! Check::sessionName( $name ) ) {
return false;
}
@ -43,7 +46,7 @@ class Session {
return false;
}
$sessionName = DEFAULT_SESSION_PREFIX . $name;
if ( self::exists( $sessionName ) ) {
if ( self::exists( $name ) ) {
return $_SESSION[ $sessionName ];
}
Debug::info( "Session::get - Session not found: $sessionName" );
@ -58,6 +61,9 @@ class Session {
* @return {bool}
*/
public static function put( $name, $data ) {
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
if ( ! Check::sessionName( $name ) ) {
return false;
}