Re: how can i check the session´s Auth for show html (login & logout)

2011-11-09 Thread WebbedIT
@Ogalov: The correct way to check if a user is logged in within the view is: $session->check('Auth.User.id'); The point is you are not wanting to read a value as you are not then using the value, you simply want to check if it exists and perform some other logic. Jeremy gave you this answer and

Re: how can i check the session´s Auth for show html (login & logout)

2011-11-08 Thread Ogalav
Jeremy, sorry but the Session->check no found it in the 'if else', i mean i use for read the user active that is all. i dont now why you say "rash of peaple doing it wrong"??? or what said webbedit !!! have i take it as sarcasm???.. I'm reading a lot of cake and I'm no expert .. but I'm getti

Re: how can i check the session´s Auth for show html (login & logout)

2011-11-08 Thread Jeremy Burns | Class Outfit
Lately there seems to be a rash of people doing it wrong, ignoring good advice and then continuing to have problems (aka "Cake is buggy/rubbish"). Jeremy Burns Class Outfit http://www.classoutfit.com On 8 Nov 2011, at 08:39, WebbedIT wrote: >> Jeremy. thank for you answer.. (but I am going to

Re: how can i check the session´s Auth for show html (login & logout)

2011-11-08 Thread WebbedIT
> Jeremy. thank for you answer.. (but I am going to ignore it) You've got to laugh, Paul -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.

Re: how can i check the session´s Auth for show html (login & logout)

2011-11-07 Thread Jeremy Burns | Class Outfit
You're doing something wrong. If the user is not logged $this->Session->read('Auth.User') will fail. $this->Session ->check is the normal way to do it. Jeremy Burns Class Outfit http://www.classoutfit.com On 7 Nov 2011, at 15:32, Ogalav wrote: > Jeremy. thank for you answer.. > > i did it li

Re: how can i check the session´s Auth for show html (login & logout)

2011-11-07 Thread Ogalav
Jeremy. thank for you answer.. i did it like this and worked : $session_active = $this->Session->read('Auth.User'); if (isset($session_active)){ echo 'Logout'; } else {

Re: how can i check the session´s Auth for show html (login & logout)

2011-11-07 Thread Jeremy Burns | Class Outfit
Instead of checking the session, do this: Session->check('Auth.User')) { echo 'Logout'; } else { echo 'Login'; }?> Jeremy Burns Class Outfit Tel: +44 (0) 208 123 3822 Mob: +44 (0) 7973 481949 Skype: jeremy_burns http://www.classoutfit.c

how can i check the session´s Auth for show html (login & logout)

2011-11-07 Thread Ogalav
Hi, i want show in the default.ctp in the header one content that will have link for logut or login, depending on the recording session active. so, i´m doing this: views/layouts/default.ctp Session->read('Auth.User'))){ e