Create use native PHP session in codeigniter

View: 638    Dowload: 0   Comment: 0   Post by: hanhga  
Author: none   Category: Codeigniter   Fields: Other

0 point/3 review File has been tested

You can add your own library to use native session in codeigniter.

Introduction

You can add your own library to use native session in codeigniter.

A CodeIgniter library is simply a class that is loaded by the framework and made available for you to use in your Controller classes.  We are going to create a new library that starts a native PHP session and allows us to store and retrieve things from it.

Go to application/libraries

Create a file name Native_session.php

 
 
 

Using your new library in a controller.

 
 
 
load->library( 'Native_session' ); 
 
        //Read the data from session
        $username = $this->Native_session->get( 'your data' );
 
        //Update shopping cart session data
        $this->Native_session->set( 'cart', $cart );
    }
}
 
?>

You can now use your new Native session library in place of the CI-supplied session library.

Hope this article how to use native PHP session in codeigniter will help you.

 

 

 

 

 

 

Create use native PHP session in codeigniter

Create use native PHP session in codeigniter Posted on 08-01-2016  You can add your own library to use native session in codeigniter. 5/10 638

Comment:

To comment you must be logged in members.

Files with category

 

File suggestion for you

File top downloads

logo codetitle
Codetitle.com - library source code to share, download the file to the community
Copyright © 2015. All rights reserved. codetitle.com Develope by Vinagon .Ltd