Welcome Guest, Not a member yet? Register   Sign In
Session processing degrades the performance greatly
#8

[eluser]huuthanh3108[/eluser]
//file config.php add a line
// two value 'CI' or 'PHP'
Code:
$config['sess_mode']        = 'PHP';

and create file MY_Session.php in folder library: My_Session.php
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$CI = & get_instance();
if($CI->config->item('sess_mode') == "PHP")//config use session of PHP
{
    class MY_session
    {
        function MY_session()
        {
            session_start();
        }
        function userdata($name)
        {
            if($name == "session_id")
                return session_id();
            else
            {
                return isset($_SESSION[$name])?$_SESSION[$name]:'';
            }
        }
        function set_userdata($name, $value)
        {
            $_SESSION[$name] = $value;
        }
        function unset_userdata($name)
        {
            $_SESSION[$name] = '';
        }
    }
    
}
else//config use session CI
{
    class MY_session extends CI_session
    {
        function MY_session()
        {
            parent::CI_Session();
        }
    }
}
?>


Messages In This Thread
Session processing degrades the performance greatly - by El Forum - 05-04-2009, 07:55 PM
Session processing degrades the performance greatly - by El Forum - 05-04-2009, 07:59 PM
Session processing degrades the performance greatly - by El Forum - 05-04-2009, 08:04 PM
Session processing degrades the performance greatly - by El Forum - 05-04-2009, 08:09 PM
Session processing degrades the performance greatly - by El Forum - 05-04-2009, 08:23 PM
Session processing degrades the performance greatly - by El Forum - 05-04-2009, 08:24 PM
Session processing degrades the performance greatly - by El Forum - 05-04-2009, 08:52 PM
Session processing degrades the performance greatly - by El Forum - 05-04-2009, 09:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB