B.5. 会话变量

Solar类使用会话时,在$_SESSION数组中的键是和类名匹配的。因此,假设Acme_Example类使用会话变量foo,那么它被放置在$_SESSION['Acme_Example']['foo']

遵循这种规范最简单的方法就是在类中使用Solar_Session存储对象。例如。。。

<?php
$session = Solar::factory('Solar_Session', array(
    'class' => 'Acme_Example',
));

// equivalent of $_SESSION['Acme_Example']['something']
$session->store['foo'] = 'bar';