CodeIgniter Forums
when i load session class the page do not load CodeIgniter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: when i load session class the page do not load CodeIgniter (/thread-56305.html)



when i load session class the page do not load CodeIgniter - El Forum - 12-09-2012

[eluser]Berzacola[/eluser]
I'm using CodeIgniter 2.1.3 and when i try to load session class the page don't load, and don't show any error either , look what i'm trying to do: ( P.S.: I've set the encryption key already ) ( It is the index of the main controller... )

Code:
public function index() {

    $this->load->library('session');

    $this->load->helper('assets_helper');


    $data['assets_url'] = assets_url();

    $this->load->view(domain_template() . '/index', $data);

}

If i do like above, the code will no load the page, but if i put like that:

Code:
public function index() {

    //$this->load->library('session');

    $this->load->helper('assets_helper');


    $data['assets_url'] = assets_url();

    $this->load->view(domain_template() . '/index', $data);

}

It's loaded, why it happen? i cant solve it!!

Stack OverFlow question:
http://stackoverflow.com/questions/13788719/when-i-load-session-class-the-page-do-not-load-codeigniter


when i load session class the page do not load CodeIgniter - El Forum - 12-11-2012

[eluser]ramirors[/eluser]
I allways load session on autoload, but if you want to load on specific controller use:

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Perfil extends CI_Controller {
    
    function __construct()
    {
        parent::__construct();
        $this->load->library('session');
    }

    function index() {

    }
....