dqgo99177 2016-04-29 11:40
浏览 21

codeigniter中的注销错误

I am trying to design a login/logout page in code igniter framework.My problem is that when I logout of the web-page I am getting redirected to a login page. When I go back I am getting a page which says:

Document Expired

This document is no longer available.

My Login controller is

public function __construct() {
        parent::__construct();

        //date_default_timezone_set("Asia/Kolkata");
        $this->load->helper(array('form', 'url'));
        $this->load->database();
        $this->load->model('User_model');
        $this->load->library(array('session', 'form_validation', 'email'));
        $this->load->file('smtp/Send_Mail.php');

        $this->output->set_header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT');
        $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
        $this->output->set_header('Pragma: no-cache');
        $this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    

    }

function Logout() {

        $user_data = $this->session->all_userdata();
        foreach ($user_data as $key => $value) {
            if ($key != 'session_id' && $key != 'ip_address' && $key != 'user_agent' && $key != 'last_activity') {
                $this->session->unset_userdata($key);
            }
        }
        $this->session->sess_destroy();
        redirect('Login');
    }

Login view page where i checked if session is exists then redirect on other page.

<?php
if($this->session->is_user_login==TRUE)
{
   redirect('User/Emailverification');
}
?>

I am not getting how to resolve this document expired error.I have dono lots of searching but i am not getting the solution of this problem.Please help me thanks in Advance.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#hadoop#的问题
    • ¥15 (标签-Python|关键词-socket)
    • ¥15 keil里为什么main.c定义的函数在it.c调用不了
    • ¥50 切换TabTip键盘的输入法
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据