Joomla会话和注册表依赖?

时间:2013-11-10 13:58:20

标签: php session joomla joomla2.5

以下是我从joomla会话表获得的会话数据。 现在我的问题是我在Jregistry和Jsession之间完全迷失了。

通过阅读来自joomla平台的代码

我发现了什么
Jregistry is not using session variable at all in set() and get().

我现在的问题是,存储在Jregistry中的数据会在会话中传递为什么?任何人都可以请我把这段代码转发给会员注册会议。

和Japplication中找到的函数setUserState正在使用一些会话变量注册表是什么?

public function setUserState($key, $value)
{
    $session = JFactory::getSession();
    $registry = $session->get('registry');

    if (!is_null($registry))
    {
        return $registry->set($key, $value);
    }

    return null;
}

我为访客用户找到的会话数据i是整数,s是字符串

  

__ default | a:8:{s:15:“session.counter”; i:1; s:19:“session.timer.start”; i:1384090452; s:18:“session.timer.last “; I:1384090452; S:17:” session.timer.now “; I:1384090452; S:22:” session.client.browser “; S:107:” 的Mozilla / 5.0   (Windows NT 6.1; WOW64)AppleWebKit / 535.11(KHTML,与Gecko一样)   镀铬/ 17.0.963.33   Safari浏览器/ 535.11 “;的 * S:8:” 注册表 “O:9:” JRegistry “:1:{S:7:” \ 0 \ 0 \ 0data “O:8:” stdClass的“:0 :{}} * S:4: “用户”,O:5: “JUser与”:24:{S:9: “\ 0 \ 0 \ 0isRoot”; N; S:2: “ID” ; I:0; S:4: “姓名”; N; S:8: “用户名”; N; S:5: “电子邮件”; N; S:8: “密码”; N; S:14:” password_clear “; S:0:” “; S:5:” 块 “; N; S:9:” sendEmail “; I:0; S:12:” registerDate “; N; S:13:” lastvisitDate“; N; S:10: “活化”; N; S:6: “PARAMS”; N; S:6: “基团”;一个:1:{I:0; S:2: “13”;} S: 5: “客人”; I:1; S:13: “lastResetTime”; N; S:10: “resetCount”; N; S:10: “\ 0 \ 0 \ 0_params”,O:9: “JRegistry” :1:{S:7: “\ 0 \ 0 \ 0data”,O:8: “stdClass的” 0:{}} S:14: “\ 0 \ 0 \ 0_authGroups”; N; S:14:” \ 0 \ 0 \ 0_authLevels “;一个:3:{I:0; I:1; I:1; I:1; I:2; I:5;} S:15:” \ 0 \ 0 \ 0_authActions” ; N,S:12: “\ 0 \ 0 \ 0_errorMsg”; N; S:10: “\ 0 \ 0 \ 0_errors”;一个:0:{} S:3: “援助”; I:0;} S:13: “session.token”; S:32: “845b6df35056177aeb84ac26db333607”;}

1 个答案:

答案 0 :(得分:0)

JRegistry中传递的数据不存储在会话中。

JRegistry是一个包装多维数组的类,允许使用'。'访问值,但JRegistry本身与JSession无关。

他们使用JRegistry作为数据数组的容器。

设置注册表的代码是:https://github.com/joomla/joomla-cms/blob/1d817d9762b0e4264d99f2257ce23dd68628df00/libraries/legacy/application/application.php#L1120