登录Kohana时出现错误消息 [英] Error message while logging in in Kohana

查看:157
本文介绍了登录Kohana时出现错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Kohana 3,并且在与用户登录时遇到问题.

I'm using Kohana 3 and I have an issue while logging in with an user.

我使用此行登录:

$success = Auth::instance()->login($_POST['login_user'], $_POST['login_password'], $remember);

我收到此错误消息:

Session_Exception [ 1 ]: Error reading session data. ~ SYSPATH/classes/kohana/session.php [ 326 ]

我具有使用以下SQL创建的会话表:

I have the sessions table created with the follow SQL:

CREATE TABLE `sessions` (
  `session_id` varchar(24) NOT NULL,
  `last_active` int(10) unsigned DEFAULT NULL,
  `contents` text,
  PRIMARY KEY (`session_id`),
  KEY `sessions_fk1` (`last_active`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

还有config文件夹中的session.php:

And also the session.php inside the config folder:

<?php defined('SYSPATH') or die('No direct script access.');

return array(
    'database' => array(
        /**
         * Database settings for session storage.
         *
         * string   group  configuation group name
         * string   table  session table name
         * integer  gc     number of requests before gc is invoked
         * columns  array  custom column names
         */
        'group'   => 'default',
        'table'   => 'sessions',
        'gc'      => 500,
        'columns' => array(
            /**
             * session_id:  session identifier
             * last_active: timestamp of the last activity
             * contents:    serialized session data
             */
            'session_id'  => 'session_id',
            'last_active' => 'last_active',
            'contents'    => 'contents'
        ),
    ),
);

?>

这里可能是什么问题?

谢谢!

推荐答案

Session_Exception [1]:读取会话数据时出错. 〜SYSPATH/classes/kohana/session.php [326]

Session_Exception [ 1 ]: Error reading session data. ~ SYSPATH/classes/kohana/session.php [ 326 ]

取决于您正在运行的版本,但这是由于在read中对会话数据进行反序列化时引发异常而引起的.您可以在此处查看有关该错误的报告:未正确忽略会话读取错误.解决方案是如果尚未升级到最新版本.

Depends what version you're running, but this is caused by an exception being thrown when session data is being unserialized in read. You can see the bug report about it here: Session read errors not properly ignored. The solution would be to upgrade to the latest version if you haven't already.

您需要查看的其他内容是会话数据.您必须查看为什么您的数据已损坏并且无法正确读取.这可能是__sleep中的代码生成的错误.

Something else you need to look at is your session data. You'll have to see why your data is corrupt and can't be read properly. This could be an error generated from code in __sleep.

这篇关于登录Kohana时出现错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆