O
O
ogneog2022-01-31 09:44:53
PHP
ogneog, 2022-01-31 09:44:53

How to get value from session?

Hello.

I exit the session, I get this:

Array ( [logged_user] => __PHP_Incomplete_Class Object ( [__PHP_Incomplete_Class_Name] => RedBeanPHP\OODBBean [properties:protected] => Array ( [id] => 1 [member_login] => 123 [password] => 123 [avatar] => [name] => ) [__info:protected] => Array ( [type] => users [sys.id] => id [sys.orig] => Array ( [id] => 1 [member_login] => 123 [password] => 123 [avatar] => [name] => ) [tainted] => [changed] => [changelist] => Array ( ) [model] => [data.bundle] => Array ( ) ) [beanHelper:protected] => __PHP_Incomplete_Class Object ( [__PHP_Incomplete_Class_Name] => RedBeanPHP\BeanHelper\SimpleFacadeBeanHelper ) [fetchType:protected] => [withSql:protected] => [withParams:protected] => Array ( ) [aliasName:protected] => [via:protected] => [noLoad:protected] => [all:protected] => ) [user] => Array ( [id] => ) )


I'm trying to get any value and it doesn't output anything. I output like this:

$id = $_SESSION['logged_user']->id;
print_r($id);

Tried with other data...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
ogneog, 2022-01-31
@ogneog

$id = $_SESSION['logged_user']->id;
    var_dump($id);

Outputs NULL
Why?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question