我需要在ajax动作之后创建具有延迟的重定向。有代码
setTimeout(function(){
window.location.href="<?php echo url::site('action'); ?>";
},2000);
在ajax成功函数中。当然我在kohana中有会话错误。我不知道如何解决这个问题。
ERROR:
Session_Exception [1]:读取会话数据时出错。 ~SYSPATH / classes / kohana / session.php [325] 未捕获的异常“
ErrorException
”,消息“未知:会话ID太长或包含非法字符,有效字符为a-z,A-Z,0-9和' - ,''在第0行的未知中
如果我使用不带$this->request->redirect('action');
这是我的会话配置
<?php defined('SYSPATH') OR die('No direct script access.');
return array(
'native' => array(
'name' => 'mail',
'lifetime' => 43200,
),
'cookie' => array(
'name' => 'mail',
'encrypted' => TRUE,
'lifetime' => 43200,
),
'database' => array(
'name' => 'mail',
'encrypted' => TRUE,
'lifetime' => 43200,
'group' => 'default',
'table' => 'sessions',
'columns' => array(
'session_id' => 'session_id',
'last_active' => 'last_active',
'contents' => 'contents'
),
'gc' => 500,
),
);
名称存在。但我不知道配置中的名称取决于更改URL中的错误而没有重定向。