Welcome Guest, Not a member yet? Register   Sign In
How to configure Session with Files
#1

(This post was last modified: 04-19-2015, 11:34 AM by casa.)

Hello,
I try to use session_data with
PHP Code:
$config['sess_driver'] = 'files';// and 
$config['sess_save_path'] = 'cache_session'// with directory 'cache_session' with all the rights (chmod (777)). I try with cache_session/ and idem
$config['sess_expiration'] = 7200;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE
But, when i'm declaring a session variable and i try to use it in a page, i've this message :
"  touch(): Unable to create file cache_session\ci_session2f5e78f45e32a3fc8dadee822e0b8d68719d7e2a : failed to open stream: No such file or directory"
Error line number 234 in Sesssion_files_driver.php

At the first call of my controller named "Defaut", no problem for writing file for session and his name is (for example) : ci_session2f5e78f45e32a3fc8dadee822e0b8d68719d7e2a.
After, when i call my function (index) of the controller named "Debut" the view is loaded but an error appears.

I'm using session by database and all is all right and i wanted to try with files.

Can you help me please ? I do make a mistake somewhere

My Controller
PHP Code:
// i set my variable session in this controller for example. In the view associated, i can use the session variable. If i reload the page error appears
class Defaut extends CI_Controller
{
 
    private $vue 'vue1' ;
 
    public function __construct() { parent::__construct(); }
 
    
  public 
function index()
 {
      
// i defined a session variable named 'essai'
      
$this->session->set_userdata('essai''coucou') ;
      
$data['title'] = 'Titre' ;
      
$this->load->view($this->vue$data);
 }

My Other controller
PHP Code:
class Debut extends CI_Controller
{
 
    private $vue 'vue2' ;
 
    public function __construct() { parent::__construct(); }
 
    
     
public function index()
    {
 
      $this->load->view($this->vue);
     }

My other view name 'vue2'
PHP Code:
<?php echo 'value of var session :'.$this->session_userdata('essai') ; ?>
// error appears 
I resume : i call my first view with my first controller named "Defaut" who create my session variable and then, i call my second controller named "Debut". The view is loaded and when i try to see the contain of my session varaible named "essai", error appears.

Thanks for your help.
Reply


Messages In This Thread
How to configure Session with Files - by casa - 04-08-2015, 11:16 PM
RE: How to configure Session with Files - by casa - 09-11-2015, 07:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB