Hi,

This is driving me mad and I hope that someone can spot the very
simple mistake I am making. I am building a shopping cart and I want
to generate a session id which then creates a shopping cart for that
session.

I have the following in app_controller.php which should create the
Cart.session id once per session. But it isn't doing that, it
regenerates the session id every page request. So it seems that
either !$this->Session->check('Cart.session') is not working, I have
tried all 3 storage methods (php,cake,database) but still no joy.

app_controller.php
[php]
        var $beforeFilter = array('_set_defaults');
        var $uses = array('ShoppingCart');
        var $helpers = array('Javascript', 'Html', 'Ajax' , 'Form');

        function _set_defaults () {
                if ( !$this->Session->check('Cart.session') ) {
                        $session = md5(uniqid(time()));
                        $this->Session->write('Cart.session',$session);
                        $this->_create_cart( $session );
                }
        }
[/php]
Am I doing something really stupid?

Thanks

Mike


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to