开发者

Sessions for Multiple Logins account

开发者 https://www.devze.com 2023-03-13 14:25 出处:网络
How does Sessions structure should look like for multiple logins? There will be three parts of logins on my website.

How does Sessions structure should look like for multiple logins?

There will be three parts of logins on my website.

/ (customer area)

/admin/ (backend/admin area)

/control-panel/ (control panel area)

You can not use same account to access all three.

I came up with like this:

$_SESSION['login']['frontend']开发者_如何学JAVA = array(
    'user_id' => 123,
    'is_logged' => true
        );


$_SESSION['login']['backend'] = array(
    'user_id' => 999,
    'is_logged' => true
        );

Is this correct or what is alternative solution?


Look's perfectly fine to me. :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号