CodeIgniter Forums

Full Version: Unable to locate the specified class: Session.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I created a pre_controller hook

public function __construct() {

it is not working and shows error.
Unable to locate the specified class: Session.php[/code]
Pre Controller will not work because CI has not loaded everything yet.
Session is still a library, until the new Session driver gets integrated into CI-develop
$autoload['drivers'] = array('session');

$hook['post_controller_constructor'] = array(

post controller constructor

another controller (Home.php)

I am still getting the same error
My earlier reply says that the Session is still a class, until the new driver is complete.

This means that instead of
$autoload['drivers'] = array('session');
you need
$autoload['libraries'] = array('session');

This will change at some point, but it is how you use the session at the moment.
I am sorry. In 3.0
i saw this following line

| Prototype:
|    $autoload['drivers'] = array('session', 'cache');

That is why i was using drivers.

In doc,

To initialize the Session class manually in your controller constructor, use the $this->load->driver function:

Once loaded, the Sessions library object will be available using:


So, should i use $this->load->library('session'); ?

I disabled hooks.
autoloaded session library.

Fatal error: Class 'CI_Driver_Library' not found in C:\codeigniter\system\libraries\Session\Session.php on line 64
For NOW, yes you have to use library('session')

Once the new session driver is incorporated, you will use driver('session').

The code changes are not quite completd, but the documentation has already been updated.

Confusing, sorry!
Actually, I just checked, and the session driver is installed. Sorry!
Let me take another look... you might have found a bug!
In config/autoload.php...
$autoload['drivers'] = array('session');
should work ... I just tried it.
I enabled session is autoload (drivers)
I disabled all my hooks. Session is working good.

Now, I have enabled my post_constroller_construction hook

$data = array(
            'u' => 'test'

Throws error

Unable to locate the specified class: Session.php
Nothing loaded after this line.
Pages: 1 2