Re: Cake 1.2 - Session woes

2007-05-01 Thread Bluefrog

I found the problem and wanted to post my findings here just in case
someone else encounters the same thing. I was using the following in
my default.ctp file and it seemed to be causing the problem for my
sessions.



I don't understand why and I have submitted a bug to see if we can't
figure out the root of the problem.

Hope this helps someone.

On May 1, 7:22 am, buzznut <[EMAIL PROTECTED]> wrote:
> Here is the exact code that I am using.
>
> function overview($id = null) {
> if (!$id) {
> $this->Session->setFlash('Invalid Company.');
> $this->redirect(array('action'=>'index'), null, true);
> }
> $company = $this->Company->read(null, $id);
>
> $this->Session->write('Company.id', $company['Company']
> ['id']);
> $this->Session->write('Company.name', $company['Company']
> ['name']);
> $this->set('company', $company);
> }
>
> I then print the session array in my app_controller.php file
>
> function beforeFilter() {
> pr($this->Session->read());
> }
>
> When I am accessing the overview action, the expected values show up
> in the session. Anywhere else they are gone.
>
> Running cake 1.2.0.4798


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Cake 1.2 - Session woes

2007-05-01 Thread buzznut

Here is the exact code that I am using.

function overview($id = null) {
if (!$id) {
$this->Session->setFlash('Invalid Company.');
$this->redirect(array('action'=>'index'), null, true);
}
$company = $this->Company->read(null, $id);

$this->Session->write('Company.id', $company['Company']
['id']);
$this->Session->write('Company.name', $company['Company']
['name']);
$this->set('company', $company);
}


I then print the session array in my app_controller.php file

function beforeFilter() {
pr($this->Session->read());
}

When I am accessing the overview action, the expected values show up
in the session. Anywhere else they are gone.

Running cake 1.2.0.4798


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Cake 1.2 - Session woes

2007-04-30 Thread buzznut

I am having a difficult time working with sessions in my cake 1.2 app.
It doesn't appear to be behaving the way that I expect.

I have an action that sets a variable using the following line of
code.

$this->Session->write('companyName',$company['Company']['name']);


When I access this action and print out the session array, I see that
the value gets set properly. When I visit any other action under the
same controller and/or other controllers, the companyName value is
empty. If I use the following line of code in place of the command
above...

$this->Session->write('companyName','My Rockin Company');

The session variable works as expected until I delete the session
variable. I am confused why this would not work and would appreciate
any help.
Thanks,


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---