Solved problem by using mt_rand() instead.
Still, I would be interested to know why rand() kept generating the
same number, while I had a cookie in use.
-Aran
On Jun 4, 11:42 am, aranworld <[EMAIL PROTECTED]> wrote:
> Ignore the part about Firefox and Internet Explorer.
>
> Here is a full description of what is happening (remember I have
> Cache.disable set to true).
>
> In Firefox, I am logged in with a cookie holding my login information.
> When I visit /pages/random_number, I see the number '80' every time I
> reload the page.
> I logout
>
> Now I go to Internet Explorer.
> I login with a cookie and when I visit /pages/random_number, I see the
> number '80' still!!!
>
> I logout, and view the page without being logged in, and I see a
> different number with every page reload.
>
> I once again login with cookies enabled, and when I visit /pages/
> random_number, I still see '80' after every single page reload?
>
> Anyone know what might be happening here?
>
> How is the result of rand() getting cached between different browsers?
>
> On Jun 4, 11:33 am, aranworld <[EMAIL PROTECTED]> wrote:
>
> > I have investigated further and it seems related to cookies. The
> > cached values happen when I am logged in and have a cookie enabled.
>
> > On Jun 4, 11:28 am, aranworld <[EMAIL PROTECTED]> wrote:
>
> > > I am experiencing a very bizarre problem.
>
> > > In core.php I have:
> > > Configure::write('Cache.disable', true);
>
> > > I have the following two files:
>
> > > pages/random_number.ctp
>
> > > <?php
> > > echo rand(0,100);
> > > ?>
>
> > > www/random_number.php
>
> > > <?php
> > > echo rand(0,100);
> > > ?>
>
> > > In Firefox:
>
> > > When I access /pages/random_number, I get the same numeric result
> > > every time I reload the page.
> > > When I access /random_number.php, I get different results every time
> > > every time I reload the page.
>
> > > In Internet Explorer, I rightfully get different results with every
> > > page reload.
>
> > > Anyone have any ideas, why the results of php's rand() are getting
> > > cached with CakePHP in Firefox, but NOT while in Internet Explorer?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---