Hi,

Its OK I found the problem, it was bacause I am developing locally and
had spaces in the directory name, this was causing the sessions not to
save!

How annoying, wasted loads of time looking for that.

Cheers

Mike

On May 26, 3:08 pm, Mike Digital Egg <[EMAIL PROTECTED]> wrote:
> Hi Anton,
>
> Thanks for your reply. I have app_controller.php in the correct place,
> the session is initially being set but for some reason it is not
> keeping the session between refreshes. I have done some session tests
> with basic php sessions which save fine. Any other ideas?
>
> Cheers
>
> Mike
>
> On May 23, 4:28 pm, Anton Morrison <[EMAIL PROTECTED]> wrote:
>
> > I had a problem getting things to work because i had the
> > app_controller.php in the /app/controllers/ folders but it has to be
> > in /app/
>
> > On 23 May 2007, at 09:29, Mike Digital Egg wrote:
>
> > > 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
>
> > Anton Morrison
> > [EMAIL PROTECTED]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
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