Welcome Guest, Not a member yet? Register   Sign In
Session resetting itself each time i add an item to a cart via ajax droppables
#2

[eluser]haraldo[/eluser]
OK,

For those who might be interested.

I added a pre_system hook that initialises a class where i do the following:

Code:
require_once 'system/application/libraries/Visitor.php';

class Session_initialise {

    function __construct() {
        session_start();
    }
    
    public function initiateVisitor() {
        if ( !isset( $_SESSION['visitor'] ) ) {
            $_SESSION['visitor'] = new Visitor();
        }
    }
}

This now allows the normal session implementation (the code in my first post that is commented out) to work.

For those of you who are seasoned codeignitors please let me know if i'm being a mong, and especially if there is a better way to do this.

Chears


Messages In This Thread
Session resetting itself each time i add an item to a cart via ajax droppables - by El Forum - 10-27-2008, 05:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB