【问题标题】:Kohana Sessions data does not persist across pages in chrome and IE browsersKohana Sessions 数据不会在 chrome 和 IE 浏览器中的页面之间持续存在
【发布时间】:2012-03-27 20:17:06
【问题描述】:

Kohana 会话数据不会在 Chrome 和 IE 浏览器中打开的页面之间保留

在 Firefox 浏览器中也可以正常工作

使用的 Kohana 版本是 2.3

会话配置文件保存

$config['driver'] = 'native';

/**
 * Session storage parameter, used by drivers.
 */
$config['storage'] = '';

/**
 * Session name.
 * It must contain only alphanumeric characters and underscores. At least one letter must be present.
 */
$config['name'] = 'NITWSESSID';

/**
 * Session parameters to validate: user_agent, ip_address, expiration.
 */
$config['validate'] = array();

/**
 * Enable or disable session encryption.
 * Note: this has no effect on the native session driver.
 * Note: the cookie driver always encrypts session data. Set to TRUE for stronger encryption.
 */
$config['encryption'] = FALSE;

/**
 * Session lifetime. Number of seconds that each session will last.
 * A value of 0 will keep the session active until the browser is closed (with a limit of 24h).
 */
$config['expiration'] = 2700;

/**
 * Number of page loads before the session id is regenerated.
 * A value of 0 will disable automatic session id regeneration.
 */
$config['regenerate'] = 0;

/**
 * Percentage probability that the gc (garbage collection) routine is started.
 */
$config['gc_probability'] = 2;

急需帮助

【问题讨论】:

    标签: internet-explorer session google-chrome kohana persist


    【解决方案1】:

    对不起,我想这应该是对你的问题的评论,但我还没有这个特权。

    无论如何,您是否使用正确的语法来实例化会话?

    $this->session = Session::instance()
    

    不是

    $this->session = new Session();
    

    来自http://dev.kohanaframework.org/issues/2225
    显然,第二个在 Firefox 中有效,但在 IE 中导致问题,对 chrome 只字未提。

    【讨论】:

      猜你喜欢
      • 2012-06-15
      • 2017-12-28
      • 2012-04-21
      • 2018-03-27
      • 1970-01-01
      • 2021-10-06
      • 2015-11-15
      • 2012-08-31
      • 2015-01-28
      相关资源
      最近更新 更多