Re: output_buffering FTW (Was: Auth session getting destroyed?)

2009-07-03 Thread Gwoo

you probably have some whitespace somewhere in your files that is
killing the session when output buffering is off.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: fixed: space after ?> tag (Was also: output_buffering FTW (Was: Auth session getting destroyed?))

2009-07-02 Thread GravyFace

Yes, I realize that now (and vaguely recall reading about this a while
ago).  Perhaps cake bake should be patched to do the same?  I just
baked another controller and while the spaces weren't there, the ?>
was.
I'm sure it was me somehow who put that in (I've been shuffling around
using a Mac and two different IDEs on Windows for the same project),
but without the end tag, these kinds of bugs can be avoided.


On Thu, Jul 2, 2009 at 5:00 PM, Miles J wrote:
>
> Just a note, you dont need ?> at the end of your php files. The file
> will work the same regardless, and you wont run into these problems.
>
> On Jul 2, 1:41 pm, GravyFace  wrote:
>> For the love of ---
>>
>> Anyways, it's working now.
>>
>> /me downs beer in triumph, shakes fist at sky.
>>
>> On Thu, Jul 2, 2009 at 4:07 PM, GravyFace wrote:
>> > So while trying to setup Zend Debugger (another epic fail, sigh), one
>> > of the tutorials I found recommended two settings in php.ini:
>>
>> > implicit_flush = On
>> > output_buffering = On
>>
>> > Give the ol' login another try and it works.  So I figure I must've
>> > removed the Auth component during one of my many many attempts at
>> > resolving this issue, but nope, it's there.  Turns out that unless
>> > output_buffering is On, Auth session key doesn't persist between
>> > requests.  Works fine now.  Any comment on this?  Everyone else have
>> > this set to 'On'?  I'm on Ubuntu 9.04 at the home office and Ubuntu
>> > 6.06 on the test server and both were set to off by default I'm
>> > assuming.
>>
>> > On Wed, Jul 1, 2009 at 2:18 PM, GravyFace wrote:
>> >> On Wed, Jul 1, 2009 at 12:26 PM, dgw wrote:
>>
>>  Using the Developer add-on for Firefox, the session cookie is still
>>  there (same one as well), just cannot retrieve Auth.User from the
>>  session, only when I first authenticate (POST).
>>
>> >>> Have you tried reading that data with $this->Auth->user();
>>
>> >> I'm doing a pr($_SESSION); there's no Auth key beyond when it first
>> >> gets set in AuthComponent->login -- i.e. if I make a GET request to
>> >> any other controller and spit out pr($_SESSION) in any other action
>> >> (including calling GET on /users/login again; I've set autoRedirect to
>> >> false), it's immediately gone.  $_SESSION itself seems to be intact --
>> >> there's a  [_Token] key consistently, but I just don't see why it's
>> >> not persisting beyond the initial set when POSTing (logging in).
> >
>

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



Re: fixed: space after ?> tag (Was also: output_buffering FTW (Was: Auth session getting destroyed?))

2009-07-02 Thread Miles J

Just a note, you dont need ?> at the end of your php files. The file
will work the same regardless, and you wont run into these problems.

On Jul 2, 1:41 pm, GravyFace  wrote:
> For the love of ---
>
> Anyways, it's working now.
>
> /me downs beer in triumph, shakes fist at sky.
>
> On Thu, Jul 2, 2009 at 4:07 PM, GravyFace wrote:
> > So while trying to setup Zend Debugger (another epic fail, sigh), one
> > of the tutorials I found recommended two settings in php.ini:
>
> > implicit_flush = On
> > output_buffering = On
>
> > Give the ol' login another try and it works.  So I figure I must've
> > removed the Auth component during one of my many many attempts at
> > resolving this issue, but nope, it's there.  Turns out that unless
> > output_buffering is On, Auth session key doesn't persist between
> > requests.  Works fine now.  Any comment on this?  Everyone else have
> > this set to 'On'?  I'm on Ubuntu 9.04 at the home office and Ubuntu
> > 6.06 on the test server and both were set to off by default I'm
> > assuming.
>
> > On Wed, Jul 1, 2009 at 2:18 PM, GravyFace wrote:
> >> On Wed, Jul 1, 2009 at 12:26 PM, dgw wrote:
>
>  Using the Developer add-on for Firefox, the session cookie is still
>  there (same one as well), just cannot retrieve Auth.User from the
>  session, only when I first authenticate (POST).
>
> >>> Have you tried reading that data with $this->Auth->user();
>
> >> I'm doing a pr($_SESSION); there's no Auth key beyond when it first
> >> gets set in AuthComponent->login -- i.e. if I make a GET request to
> >> any other controller and spit out pr($_SESSION) in any other action
> >> (including calling GET on /users/login again; I've set autoRedirect to
> >> false), it's immediately gone.  $_SESSION itself seems to be intact --
> >> there's a  [_Token] key consistently, but I just don't see why it's
> >> not persisting beyond the initial set when POSTing (logging in).
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



fixed: space after ?> tag (Was also: output_buffering FTW (Was: Auth session getting destroyed?))

2009-07-02 Thread GravyFace

For the love of ---

Anyways, it's working now.

/me downs beer in triumph, shakes fist at sky.

On Thu, Jul 2, 2009 at 4:07 PM, GravyFace wrote:
> So while trying to setup Zend Debugger (another epic fail, sigh), one
> of the tutorials I found recommended two settings in php.ini:
>
> implicit_flush = On
> output_buffering = On
>
> Give the ol' login another try and it works.  So I figure I must've
> removed the Auth component during one of my many many attempts at
> resolving this issue, but nope, it's there.  Turns out that unless
> output_buffering is On, Auth session key doesn't persist between
> requests.  Works fine now.  Any comment on this?  Everyone else have
> this set to 'On'?  I'm on Ubuntu 9.04 at the home office and Ubuntu
> 6.06 on the test server and both were set to off by default I'm
> assuming.
>
> On Wed, Jul 1, 2009 at 2:18 PM, GravyFace wrote:
>> On Wed, Jul 1, 2009 at 12:26 PM, dgw wrote:
>>>
 Using the Developer add-on for Firefox, the session cookie is still
 there (same one as well), just cannot retrieve Auth.User from the
 session, only when I first authenticate (POST).
>>>
>>> Have you tried reading that data with $this->Auth->user();
>>>
>>
>> I'm doing a pr($_SESSION); there's no Auth key beyond when it first
>> gets set in AuthComponent->login -- i.e. if I make a GET request to
>> any other controller and spit out pr($_SESSION) in any other action
>> (including calling GET on /users/login again; I've set autoRedirect to
>> false), it's immediately gone.  $_SESSION itself seems to be intact --
>> there's a  [_Token] key consistently, but I just don't see why it's
>> not persisting beyond the initial set when POSTing (logging in).
>>
>

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



output_buffering FTW (Was: Auth session getting destroyed?)

2009-07-02 Thread GravyFace

So while trying to setup Zend Debugger (another epic fail, sigh), one
of the tutorials I found recommended two settings in php.ini:

implicit_flush = On
output_buffering = On

Give the ol' login another try and it works.  So I figure I must've
removed the Auth component during one of my many many attempts at
resolving this issue, but nope, it's there.  Turns out that unless
output_buffering is On, Auth session key doesn't persist between
requests.  Works fine now.  Any comment on this?  Everyone else have
this set to 'On'?  I'm on Ubuntu 9.04 at the home office and Ubuntu
6.06 on the test server and both were set to off by default I'm
assuming.

On Wed, Jul 1, 2009 at 2:18 PM, GravyFace wrote:
> On Wed, Jul 1, 2009 at 12:26 PM, dgw wrote:
>>
>>> Using the Developer add-on for Firefox, the session cookie is still
>>> there (same one as well), just cannot retrieve Auth.User from the
>>> session, only when I first authenticate (POST).
>>
>> Have you tried reading that data with $this->Auth->user();
>>
>
> I'm doing a pr($_SESSION); there's no Auth key beyond when it first
> gets set in AuthComponent->login -- i.e. if I make a GET request to
> any other controller and spit out pr($_SESSION) in any other action
> (including calling GET on /users/login again; I've set autoRedirect to
> false), it's immediately gone.  $_SESSION itself seems to be intact --
> there's a  [_Token] key consistently, but I just don't see why it's
> not persisting beyond the initial set when POSTing (logging in).
>

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



Re: Auth session getting destroyed?

2009-07-01 Thread GravyFace

On Wed, Jul 1, 2009 at 12:26 PM, dgw wrote:
>
>> Using the Developer add-on for Firefox, the session cookie is still
>> there (same one as well), just cannot retrieve Auth.User from the
>> session, only when I first authenticate (POST).
>
> Have you tried reading that data with $this->Auth->user();
>

I'm doing a pr($_SESSION); there's no Auth key beyond when it first
gets set in AuthComponent->login -- i.e. if I make a GET request to
any other controller and spit out pr($_SESSION) in any other action
(including calling GET on /users/login again; I've set autoRedirect to
false), it's immediately gone.  $_SESSION itself seems to be intact --
there's a  [_Token] key consistently, but I just don't see why it's
not persisting beyond the initial set when POSTing (logging in).

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



Re: Auth session getting destroyed?

2009-07-01 Thread dgw

> Using the Developer add-on for Firefox, the session cookie is still
> there (same one as well), just cannot retrieve Auth.User from the
> session, only when I first authenticate (POST).

Have you tried reading that data with $this->Auth->user();

David

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



Re: Auth session getting destroyed?

2009-07-01 Thread GravyFace

I should note that I don't see CakeSession's delete method called, nor
do I see it being overwritten with a null value.

On Wed, Jul 1, 2009 at 11:34 AM, GravyFace wrote:
> Wow, I'm totally stumped... anybody else know why Auth.User disappears
> between requests?  I have a Debugger::trace() line in CakeSession's
> write and delete methods (and also a pr() statement for the function
> args) and I can see it getting written after calling Auth->login, but
> make another request somewhere else and the Auth session key is
> completely missing.  I'm reaching here, but does the User object's
> password field need to be stored in the Auth.User array?  That's the
> only field I see missing.
>
>
> On Tue, Jun 30, 2009 at 11:21 PM, GravyFace wrote:
>> Set it to low and medium; no dice.
>>
>> On Tue, Jun 30, 2009 at 9:17 PM, Miles J wrote:
>>>
>>> Try setting your security level to medium and see what happens.
>>> >>>
>>>
>>
>

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



Re: Auth session getting destroyed?

2009-07-01 Thread GravyFace

Wow, I'm totally stumped... anybody else know why Auth.User disappears
between requests?  I have a Debugger::trace() line in CakeSession's
write and delete methods (and also a pr() statement for the function
args) and I can see it getting written after calling Auth->login, but
make another request somewhere else and the Auth session key is
completely missing.  I'm reaching here, but does the User object's
password field need to be stored in the Auth.User array?  That's the
only field I see missing.


On Tue, Jun 30, 2009 at 11:21 PM, GravyFace wrote:
> Set it to low and medium; no dice.
>
> On Tue, Jun 30, 2009 at 9:17 PM, Miles J wrote:
>>
>> Try setting your security level to medium and see what happens.
>> >>
>>
>

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



Re: Auth session getting destroyed?

2009-06-30 Thread GravyFace

Set it to low and medium; no dice.

On Tue, Jun 30, 2009 at 9:17 PM, Miles J wrote:
>
> Try setting your security level to medium and see what happens.
> >
>

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



Re: Auth session getting destroyed?

2009-06-30 Thread Miles J

Try setting your security level to medium and see what happens.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Auth session getting destroyed?

2009-06-30 Thread GravyFace

On Tue, Jun 30, 2009 at 8:48 PM, GravyFace wrote:
> On Tue, Jun 30, 2009 at 8:41 PM, GravyFace wrote:
>> On Tue, Jun 30, 2009 at 8:20 PM, Miles J wrote:
>>>
>>> What are your session/core/auth settings?
>> http://pastebin.com/m3cfd4150
>
> ^^^ that's my core.php.
>
> app_controller.php:
> http://pastebin.com/m444d1c56
>
> users_controller.php:
> http://pastebin.com/m41b2d9a0

Using the Developer add-on for Firefox, the session cookie is still
there (same one as well), just cannot retrieve Auth.User from the
session, only when I first authenticate (POST).

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



Re: Auth session getting destroyed?

2009-06-30 Thread GravyFace

On Tue, Jun 30, 2009 at 8:41 PM, GravyFace wrote:
> On Tue, Jun 30, 2009 at 8:20 PM, Miles J wrote:
>>
>> What are your session/core/auth settings?
> http://pastebin.com/m3cfd4150

^^^ that's my core.php.

app_controller.php:
http://pastebin.com/m444d1c56

users_controller.php:
http://pastebin.com/m41b2d9a0

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



Re: Auth session getting destroyed?

2009-06-30 Thread GravyFace

On Tue, Jun 30, 2009 at 8:20 PM, Miles J wrote:
>
> What are your session/core/auth settings?
http://pastebin.com/m3cfd4150

> May we also see your login action.

login action is empty.

Thanks for your help.

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



Re: Auth session getting destroyed?

2009-06-30 Thread Miles J

What are your session/core/auth settings?

May we also see your login action.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[cakephp] Auth session getting destroyed?

2009-06-30 Thread GravyFace

Not sure what's going on, but using Auth in it's simplest form
(login.ctp, empty login action, etc.), my Auth.User session key is
null as soon as I leave the login action (which is blank).

I have pr($session->read('Auth.User'); in my login.ctp view; after I
POST, it retrieves a record and seems to authenticate ok as the pr
statement shows the User object array with all the proper values from
the database.  However, if I call the same pr on another controller's
action, or if I simply GET the login action, the Auth session key is
immediately destroyed.  Tested in FF 3, IE7, Chrome 2.x.

Any ideas?

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