Re: reset Session variables without any visible cause

2008-06-23 Thread Jaime

Same for me (1.2.0.7125 RC1).

I (apparently) solved id by setting Session.checkAgent = false and
Security.level = medium in config.php.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: reset Session variables without any visible cause

2008-06-19 Thread Yuriy K.

The same problem...
It's happening when I have broken images (with 404 response code) on
the page.
When there are no 404's -- everything is fine.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: reset Session variables without any visible cause

2008-06-12 Thread Mike52

Whether I use:
  $_SESSION['captcha']
or
  $this->Session->read('captcha')

this does not make a difference in the behavior.
The security level was already set to low.

To me this definitely looks like a bug in RC1.

On Jun 8, 6:27 pm, "b logica" <[EMAIL PROTECTED]> wrote:
> On Sun, Jun 8, 2008 at 4:34 AM,Mike52<[EMAIL PROTECTED]> wrote:
>
> > I noticed this problem after upgrading from 1.2.0.6311 beta to
> > 1.2.0.7125 RC1
>
> > My captcha check did not work after upgrading.
> > I am using this captchahttp://captcha.ru/en/kcaptcha/in the vendors
> > directory.
> > The render method for the image does this:
> >  $this->controller->Session->write('captcha', $kcaptcha-
> >>getKeyString());
>
> > In the controller action (user registration) the value entered by the
> > user is checked against the value in the session:
> >  if ($this->data['User']['captchaCode'] != $_SESSION['captcha']) {
>
> > In the beta version of CakePHP,  this works fine.
>
> > In the RC version, $_SESSION['captcha'] is not set.
>
> > This is a clear and reproducable difference between the 2 Cakephp
> > versions.
> > Any suggestions where to look next?
>
> $this->controller->Session != $_SESSION
>
> Also, if Security.level set to 'high' you might want to bring it down
> a notch. That's known to cause this sort of problem, as well.
>
> Configure::write('Security.level', 'medium');
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: reset Session variables without any visible cause

2008-06-09 Thread Andrew Assarattanakul

I had this same problem when I upgraded from v1.2.0.6311 beta to
v1.2.0.7125 RC1.

For my session variables I had:
Session.save = php
Session.cookie = cakephp
Session.timeout = 120
Session.checkAgent = true
Security.level = high

The problem I had was the session would loose the data that was set in
the controller fairly quickly after it was set. So for example I'd add
something to it. Refresh it once, the data will still be there, but
after I refresh it again for the second and sometimes third time the
session data would be gone.

For reference my program was NOT using ajax so you may need to set the
checkAgent to false as Chris suggested.

I changed my Security level to medium and everything works the way it
was before the core was updated.

On Jun 8, 11:27 am, "b logica" <[EMAIL PROTECTED]> wrote:
> On Sun, Jun 8, 2008 at 4:34 AM, Mike52 <[EMAIL PROTECTED]> wrote:
>
> > I noticed this problem after upgrading from 1.2.0.6311 beta to
> > 1.2.0.7125 RC1
>
> > My captcha check did not work after upgrading.
> > I am using this captchahttp://captcha.ru/en/kcaptcha/in the vendors
> > directory.
> > The render method for the image does this:
> >  $this->controller->Session->write('captcha', $kcaptcha-
> >>getKeyString());
>
> > In the controller action (user registration) the value entered by the
> > user is checked against the value in the session:
> >  if ($this->data['User']['captchaCode'] != $_SESSION['captcha']) {
>
> > In the beta version of CakePHP,  this works fine.
>
> > In the RC version, $_SESSION['captcha'] is not set.
>
> > This is a clear and reproducable difference between the 2 Cakephp
> > versions.
> > Any suggestions where to look next?
>
> $this->controller->Session != $_SESSION
>
> Also, if Security.level set to 'high' you might want to bring it down
> a notch. That's known to cause this sort of problem, as well.
>
> Configure::write('Security.level', 'medium');
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: reset Session variables without any visible cause

2008-06-08 Thread b logica

On Sun, Jun 8, 2008 at 4:34 AM, Mike52 <[EMAIL PROTECTED]> wrote:
>
> I noticed this problem after upgrading from 1.2.0.6311 beta to
> 1.2.0.7125 RC1
>
> My captcha check did not work after upgrading.
> I am using this captcha http://captcha.ru/en/kcaptcha/ in the vendors
> directory.
> The render method for the image does this:
>  $this->controller->Session->write('captcha', $kcaptcha-
>>getKeyString());
>
> In the controller action (user registration) the value entered by the
> user is checked against the value in the session:
>  if ($this->data['User']['captchaCode'] != $_SESSION['captcha']) {
>
> In the beta version of CakePHP,  this works fine.
>
> In the RC version, $_SESSION['captcha'] is not set.
>
> This is a clear and reproducable difference between the 2 Cakephp
> versions.
> Any suggestions where to look next?

$this->controller->Session != $_SESSION

Also, if Security.level set to 'high' you might want to bring it down
a notch. That's known to cause this sort of problem, as well.

Configure::write('Security.level', 'medium');

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: reset Session variables without any visible cause

2008-06-08 Thread Mike52

I noticed this problem after upgrading from 1.2.0.6311 beta to
1.2.0.7125 RC1

My captcha check did not work after upgrading.
I am using this captcha http://captcha.ru/en/kcaptcha/ in the vendors
directory.
The render method for the image does this:
  $this->controller->Session->write('captcha', $kcaptcha-
>getKeyString());

In the controller action (user registration) the value entered by the
user is checked against the value in the session:
  if ($this->data['User']['captchaCode'] != $_SESSION['captcha']) {

In the beta version of CakePHP,  this works fine.

In the RC version, $_SESSION['captcha'] is not set.

This is a clear and reproducable difference between the 2 Cakephp
versions.
Any suggestions where to look next?

-- Mike

On Jun 6, 12:09 am, francky06l <[EMAIL PROTECTED]> wrote:
> What I have noticed is, in case of Debug > 0, if you have error in
> your code that generates warning or error before you render the view,
> usually you loose yoursession. Basically you can make an error in
> view, you will be ok, in model or controller yoursessionis lost.
> Maybe I am wrong, and this was base to the 1.2 branch few weeks ago. I
> will make some more tests.
> As Chris said, I am using checkAgent => false, and security.Level to
> medium.
> hth
>
> On Jun 5, 9:36 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > On Thu, Jun 5, 2008 at 3:27 PM, Jeff <[EMAIL PROTECTED]> wrote:
> > > But, the question is, why does it happen sometimes (randomly) and not
> > > other times.  I
> > > know exactly what the others are going through, because it is
> > > happening
> > > on my site too. I can do the exact same steps that killed mysession,
> > > and it will
> > > work.  If it was a coding error, then it would be reproducible by
> > > doing the exact
> > > same thing that caused it to fail the first time.
>
> > When things happen randomly, there are usually two possible problems:
>
> > 1) the framework is wrong
> > 2) your own code is wrong
>
> > While I will concede that from time to time, the framework is wrong,
> > more often than not it is your own code that is wrong.  This is not
> > meant as a slight, this is simply reality.  I write shitty code all
> > the time and when the app goes kablooey it is my fault, not the
> > framework.
>
> > None of the people who complained in the thread about having problems
> > bothered to provide code samples, so who the hell knows what the
> > problem really is.  Show us a sample inhttp://bin.cakephp.orgofyour
> > code that is not working properly and that might point these people in
> > the right direction.
>
> > --
> > Chris Hartjes
> > Internet Loudmouth
> > Motto for 2008: "Moving from herding elephants to handling snakes..."
> > @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: reset Session variables without any visible cause

2008-06-05 Thread francky06l

What I have noticed is, in case of Debug > 0, if you have error in
your code that generates warning or error before you render the view,
usually you loose your session. Basically you can make an error in
view, you will be ok, in model or controller your session is lost.
Maybe I am wrong, and this was base to the 1.2 branch few weeks ago. I
will make some more tests.
As Chris said, I am using checkAgent => false, and security.Level to
medium.
hth

On Jun 5, 9:36 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Thu, Jun 5, 2008 at 3:27 PM, Jeff <[EMAIL PROTECTED]> wrote:
> > But, the question is, why does it happen sometimes (randomly) and not
> > other times.  I
> > know exactly what the others are going through, because it is
> > happening
> > on my site too. I can do the exact same steps that killed my session,
> > and it will
> > work.  If it was a coding error, then it would be reproducible by
> > doing the exact
> > same thing that caused it to fail the first time.
>
> When things happen randomly, there are usually two possible problems:
>
> 1) the framework is wrong
> 2) your own code is wrong
>
> While I will concede that from time to time, the framework is wrong,
> more often than not it is your own code that is wrong.  This is not
> meant as a slight, this is simply reality.  I write shitty code all
> the time and when the app goes kablooey it is my fault, not the
> framework.
>
> None of the people who complained in the thread about having problems
> bothered to provide code samples, so who the hell knows what the
> problem really is.  Show us a sample inhttp://bin.cakephp.orgof your
> code that is not working properly and that might point these people in
> the right direction.
>
> --
> Chris Hartjes
> Internet Loudmouth
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: reset Session variables without any visible cause

2008-06-05 Thread Chris Hartjes

On Thu, Jun 5, 2008 at 3:27 PM, Jeff <[EMAIL PROTECTED]> wrote:
> But, the question is, why does it happen sometimes (randomly) and not
> other times.  I
> know exactly what the others are going through, because it is
> happening
> on my site too. I can do the exact same steps that killed my session,
> and it will
> work.  If it was a coding error, then it would be reproducible by
> doing the exact
> same thing that caused it to fail the first time.

When things happen randomly, there are usually two possible problems:

1) the framework is wrong
2) your own code is wrong

While I will concede that from time to time, the framework is wrong,
more often than not it is your own code that is wrong.  This is not
meant as a slight, this is simply reality.  I write shitty code all
the time and when the app goes kablooey it is my fault, not the
framework.

None of the people who complained in the thread about having problems
bothered to provide code samples, so who the hell knows what the
problem really is.  Show us a sample in http://bin.cakephp.org of your
code that is not working properly and that might point these people in
the right direction.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: reset Session variables without any visible cause

2008-06-05 Thread Jeff

> Here's a crazy thought:  you are doing something wrong in your code.
>
> I have found in my vast experience with CakePHP that sessions don't
> magically disappear, but they disappear for a variety of well-known
> reasons.  Some of which you might be able to find by searching this
> Google group.
>
> If you are using CakePHP 1.2, I suggest you check in config/core.php
> and see what you've setSession.checkAgent to be.  If you are doing
> anything with Ajax, you usually need to set this to 'false' or else it
> causes a newsessionto be created, thus dumping all your oldsession
> information.
>
>
> When doing anything in Cake, I believe there is a really good rule to follow:
>
> Don't assume it's a bug in Cake if your code won't work properly.
>

But, the question is, why does it happen sometimes (randomly) and not
other times.  I know exactly what the others are going through,
because it is happening on my site too. I can do the exact same steps
that killed my session, and it will work fine.  If it was a coding
error, then it would be reproducible by doing the exact same thing
that caused it to fail the first time.  It doesn't just happen in one
place, it happens all over the site, but there is no reason, because
it works one time, then dies another time.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: reset Session variables without any visible cause

2008-06-05 Thread Jeff

> Here's a crazy thought:  you are doing something wrong in your code.
>
> I have found in my vast experience with CakePHP that sessions don't
> magically disappear, but they disappear for a variety of well-known
> reasons.  Some of which you might be able to find by searching this
> Google group.
>
> If you are using CakePHP 1.2, I suggest you check in config/core.php
> and see what you've setSession.checkAgent to be.  If you are doing
> anything with Ajax, you usually need to set this to 'false' or else it
> causes a newsessionto be created, thus dumping all your oldsession
> information.
>
>
> When doing anything in Cake, I believe there is a really good rule to follow:
>
> Don't assume it's a bug in Cake if your code won't work properly.
>

But, the question is, why does it happen sometimes (randomly) and not
other times.  I
know exactly what the others are going through, because it is
happening
on my site too. I can do the exact same steps that killed my session,
and it will
work.  If it was a coding error, then it would be reproducible by
doing the exact
same thing that caused it to fail the first time.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: reset Session variables without any visible cause

2008-04-25 Thread Chris Hartjes

On Sun, Mar 16, 2008 at 8:58 AM, jano <[EMAIL PROTECTED]> wrote:
>
>  I'm sorry to bother you with this strange problem, but I don't know
>  really how manage it.
>  Permorfing some action in my cake application, variables session are
>  'sometimes' resetted. It happens not so often, and in a unpredictable
>  way: i.e. the same manipulation, repeated again, does not have this
>  'reset'.

Here's a crazy thought:  you are doing something wrong in your code.

I have found in my vast experience with CakePHP that sessions don't
magically disappear, but they disappear for a variety of well-known
reasons.  Some of which you might be able to find by searching this
Google group.

If you are using CakePHP 1.2, I suggest you check in config/core.php
and see what you've set Session.checkAgent to be.  If you are doing
anything with Ajax, you usually need to set this to 'false' or else it
causes a new session to be created, thus dumping all your old session
information.

I suggest pasting some of your code into bin.cakephp.org so others can
see what you're doing.

When doing anything in Cake, I believe there is a really good rule to follow:

Don't assume it's a bug in Cake if your code won't work properly.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: reset Session variables without any visible cause

2008-04-25 Thread Thomas Jones

Checked with debug set to 0, unfortunately it didn't help.



On Apr 24, 5:24 pm, cradick <[EMAIL PROTECTED]> wrote:
> I don't have the problem anymore, but not exactly sure why it went
> away. I seem to remember that the error was related to a stack
> overflow due to the debug level set at 2 (probably search to find this
> thread). This caused some custom code in my app_controller.php to fail
> because the variables passed into it were lost. Then, for some reason
> the error generated by app_controller reset the session variables.
> Now, in app_controller I verify that a variable is set before trying
> to use it and I see the correct error message. Hope that helps...
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: reset Session variables without any visible cause

2008-04-24 Thread cradick

I don't have the problem anymore, but not exactly sure why it went
away. I seem to remember that the error was related to a stack
overflow due to the debug level set at 2 (probably search to find this
thread). This caused some custom code in my app_controller.php to fail
because the variables passed into it were lost. Then, for some reason
the error generated by app_controller reset the session variables.
Now, in app_controller I verify that a variable is set before trying
to use it and I see the correct error message. Hope that helps...

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: reset Session variables without any visible cause

2008-04-24 Thread Thomas Jones

Same problem here. I set a variable in a component, can access it in a
view but after sending the form the variables seem to be empty.

strange...

On Mar 30, 11:03 pm, Mauricio Morales <[EMAIL PROTECTED]> wrote:
> I have the same strange problem...
>
> I'm working with CakePHP 1.2B and sessions saved into a PostgreSQL
> Database.
>
> On Mar 16, 7:58 am, jano <[EMAIL PROTECTED]> wrote:
>
> > I'm sorry to bother you with this strange problem, but I don't know
> > really how manage it.
> > Permorfing some action in my cake application, variables session are
> > 'sometimes' resetted. It happens not so often, and in a unpredictable
> > way: i.e. the same manipulation, repeated again, does not have this
> > 'reset'.
>
> > I've tried to change the security level from high, to medium, to low.
> > I've tried to change the session management from php to database, and
> > I've seen that simply when 'reset' start, a new session begin.
>
> > I have had before a similar problem, but it was because an helper of
> > mine was saved in a UTF-8 codage, and so headers were sent before
> > session begins (translating it in 8bit resolved the problem). I'm
> > searching if there is some file that has a UTF-8 codage, but until now
> > I've not found anything (moreover, if that was the case, that would be
> > strange this problems happens randomly, it should be persistent).
>
> > I'm printing the session variables on the main layout, and I've seen
> > that [Config][userAgent] remais the same through resets...
>
> > Any ideas, suggestions?
> > Thank you in advance.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: reset Session variables without any visible cause

2008-03-30 Thread Mauricio Morales

I have the same strange problem...

I'm working with CakePHP 1.2B and sessions saved into a PostgreSQL
Database.



On Mar 16, 7:58 am, jano <[EMAIL PROTECTED]> wrote:
> I'm sorry to bother you with this strange problem, but I don't know
> really how manage it.
> Permorfing some action in my cake application, variables session are
> 'sometimes' resetted. It happens not so often, and in a unpredictable
> way: i.e. the same manipulation, repeated again, does not have this
> 'reset'.
>
> I've tried to change the security level from high, to medium, to low.
> I've tried to change the session management from php to database, and
> I've seen that simply when 'reset' start, a new session begin.
>
> I have had before a similar problem, but it was because an helper of
> mine was saved in a UTF-8 codage, and so headers were sent before
> session begins (translating it in 8bit resolved the problem). I'm
> searching if there is some file that has a UTF-8 codage, but until now
> I've not found anything (moreover, if that was the case, that would be
> strange this problems happens randomly, it should be persistent).
>
> I'm printing the session variables on the main layout, and I've seen
> that [Config][userAgent] remais the same through resets...
>
> Any ideas, suggestions?
> Thank you in advance.

--~--~-~--~~~---~--~~
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: reset Session variables without any visible cause

2008-03-30 Thread Tulio Faria

I'm having the same problem too...

I usually get this error when I double-click a link. I guess there is
something wrong when a cake request doesnt start and end.

Does anyone have the same problem? Solutions?

On 16 mar, 19:55, cradick <[EMAIL PROTECTED]> wrote:
> I am having the same problem. I think it has something to do with cake
> 1.2 when an error occurs in a view. I read something earlier that lead
> me to believe it was a memory problem, but now I can't find that
> thread.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---