How do you have sessions configured. Are you using php, cake or
database sessions?


On May 4, 2:17 pm, LordZardeck <s...@blackfireweb.com> wrote:
> Adding still doesn't help. I REALLY need to figure this out. its so
> wierd because the sessions work when you add var $uses = array(), even
> when I don't have the Session componet added! its not even in the
> app_controller!
>
> On May 4, 10:42 am, thatsgreat2345 <thatsgreat2...@gmail.com> wrote:
>
>
>
> > Not a clue, would have to look into the core for that. But either way
> > just add var $components = array('Session'); to both of them.
>
> > On May 3, 7:21 pm, LordZardeck <s...@blackfireweb.com> wrote:
>
> > > Ok, I found out that the problem arises when I use a model. When I set
> > > the $uses varibale to an empty array, it works. What would cause this?
>
> > > On May 3, 6:21 pm, thatsgreat2345 <thatsgreat2...@gmail.com> wrote:
>
> > > > Include the session component....
>
> > > > On May 3, 3:59 pm, LordZardeck <s...@blackfireweb.com> wrote:
>
> > > > > For some reason, the session handling works in one controller and not
> > > > > the other. I can't figure out why. I am using CakePHP 1.2.5.
>
> > > > > //
> > > > > //Does work
> > > > > //
>
> > > > > sessions_controller.php:
>
> > > > > class SessionsController extends AppController {
> > > > >     var $name = "Sessions";
> > > > >     var $layout = "ajax";
> > > > >     var $uses = array();
>
> > > > >     function create(){
> > > > >         if($this->Session->read('Data') == null){
> > > > >             $this->Session->write('Data', rand());
> > > > >         }
> > > > >         $this->set('data', $this->Session->read('Data'));
> > > > >         $this->set('SessionID', $this->Session->id());
> > > > >     }
>
> > > > > }
>
> > > > > create.ctp:
> > > > > $msgJson["SessionID"] = $SessionID;
> > > > > $msgJson["data"] = $data;
> > > > > echo json_encode($msgJson);
> > > > > //results in ({"SessionID":"sd8s8o32edmjnjt94ouse99fd2","data":19409})
> > > > > every time (parenthesis not in result)
>
> > > > > //
> > > > > //Doesn't Work
> > > > > //
>
> > > > > messages_controller.php:
>
> > > > > class MessagesController extends AppController {
>
> > > > >     var $name = 'Messages';
> > > > >     var $layout = "ajax";
>
> > > > >     function listMessages() {
> > > > >         if($this->Session->read('Data') == null){
> > > > >             $this->Session->write('Data', rand());
> > > > >         }
> > > > >         $this->set('data', $this->Session->read('Data'));
> > > > >         $this->set('SessionID', $this->Session->id());
> > > > >         $this->set('messages', $this->Message->find("all",
> > > > > array("order"=>"priority ASC")));
> > > > >     }
>
> > > > > }
>
> > > > > list_messages.ctp:
>
> > > > > $msgJson["count"] = count($messages);
> > > > > $msgJson["SessionID"] = $SessionID;
> > > > > $msgJson["SessionData"] = $data;
> > > > > foreach($messages as $message){
> > > > >     $msg[] = $message["Message"];}
>
> > > > > $msgJson["items"] = $msg;
> > > > > echo json_encode($msgJson);
> > > > > /*
> > > > > results in ({"count":3,"SessionID":"","SessionData":27384,"items":
> > > > > [{"id":"4","priority":"3","subject":"Another
> > > > > message","message":"adsfasdf"},
> > > > > {"id":"2","priority":"3","subject":"testing again","message":"just
> > > > > seeing ow "},
> > > > > {"id":"7","priority":"3","subject":"asdgasdg","message":"asdfasdfasd"}]})
> > > > > except the SessionData changes everytime and the SessionID never shows
> > > > > up.
> > > > > */
>
> > > > > Any ideas what might be wrong?
>
> > > > > Check out the new CakePHP Questions 
> > > > > sitehttp://cakeqs.organdhelpotherswiththeir CakePHP related questions.
>
> > > > > You received this message because you are subscribed to the Google 
> > > > > Groups "CakePHP" group.
> > > > > To post to this group, send email to cake-php@googlegroups.com
> > > > > To unsubscribe from this group, send email to
> > > > > cake-php+unsubscr...@googlegroups.com For more options, visit this 
> > > > > group athttp://groups.google.com/group/cake-php?hl=en
>
> > > > Check out the new CakePHP Questions 
> > > > sitehttp://cakeqs.organdhelpotherswith their CakePHP related questions.
>
> > > > You received this message because you are subscribed to the Google 
> > > > Groups "CakePHP" group.
> > > > To post to this group, send email to cake-php@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > cake-php+unsubscr...@googlegroups.com For more options, visit this 
> > > > group athttp://groups.google.com/group/cake-php?hl=en-Hidequotedtext -
>
> > > > - Show quoted text -
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers 
> > > with their CakePHP related questions.
>
> > > You received this message because you are subscribed to the Google Groups 
> > > "CakePHP" group.
> > > To post to this group, send email to cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > > athttp://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en-Hide quoted text -
>
> > - Show quoted text -
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Reply via email to