Sorry for dragging up an old thread, but I'm having this same problem.
Using mt_rand() instead of rand() wasn't appealing to me, since it
just 'fixes' a symptom instead of the underlying problem, so I decided
to hunt down the issue (using version 1.2.4).

I tracked the problem down to Security::cipher(), specifically line
183, which is: srand(CIPHER_SEED);

srand() is seeding PHP's random number algorithm, and this seed seems
to stick through the entire load process of the application.

Here's the ironic part, since Miles is the one who started the thread
- the call to Security::cipher() is originally in your AutoLogin
component! :) Here's the 'stack':

- AutoLoginComponent::startup() line 61 calls CookieComponent::read()
- CookieComponent::read() line 238 calls CookieComponent::__decrypt()
- CookieComponent::__decrypt() line 427 calls Security::cipher()
- Security::cipher() line 183 calls srand()

And that's it... I think.

That said, I'm not sure how to go about fixing the issue. So maybe
I'll just use mt_rand() for now. ;)


- Jamie


On Aug 4, 6:03 pm, Miles J <[email protected]> wrote:
> Not necessarily, but ive been having this problem withrand() for
> months, but it got to the point where it caused problems.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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