Márcio Gonzalez Márcio Gonzalez - 1 month ago 9x
Apache Configuration Question

CodeIgniter session permission

I developed a codeigniter application that sometimes throw an exception in session_start.

The returned code is:

A PHP Error was encountered

Severity: Notice

Message: session_start(): ps_files_cleanup_dir: opendir(/tmp) failed: Permission denied (13)

Filename: core/MY_Controller.php

Line Number: 2

In this line, I have just "session_start"

But this problem occurs occasionally.

Should I change the temp folder to another one inside CI folder?



You need to set session path in configuration settings

  • In application/config/config.php set

    $config['sess_save_path'] = FCPATH . 'application/cache/sessions/';

It works for me.