HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: /var/www/html/appointmentbook.me/wp-content/plugins/booknetic/app/Providers/Helpers/Session.php
<?php

namespace BookneticApp\Providers\Helpers;

use BookneticApp\Providers\Core\Permission;

class Session
{

	const SESSION_PREFIX = 'bkntc_';

	public static function set( $session_name, $session_value = null )
	{
		$userId = Permission::userId();

		self::delete( $session_name );

		add_user_meta( $userId, static::SESSION_PREFIX . $session_name, $session_value, true );
	}

	public static function get( $session_name, $default = null )
	{
		$userId = Permission::userId();

		$sess = get_user_meta( $userId, static::SESSION_PREFIX . $session_name, true );

		return empty( $sess ) ? $default : $sess;
	}

	public static function delete( $session_name )
	{
		$userId = Permission::userId();

		delete_user_meta( $userId, static::SESSION_PREFIX . $session_name );
	}


}