Page 1 of 2
1 · 2

Jasper :: 20.02.2008 03:49:04
data is an array with your username and password...

why not just use $this->Auth->login($data) ?

Auth component should take care of the rest
lecterror :: 20.02.2008 04:40:15
Do you mean the $cookie var? I've tried that and it didn't work. I couldn't figure out why, so I (ab)used the fact that Auth->login accepts model as a parameter. I'm still not sure what's the difference though..
Jelmer :: 09.03.2008 06:51:48
Interesting, just what I'm looking for! I've tried implementing this code into my own auth system which is pretty similar I think, but can't get it to work yet. I'm not sure what the problem is, but I think the cookie isn't being set, after login I look at the cookies set by entering this in my browser:


Unfortunately all i get is something like Cakephp= "random string" I don't think this is correct, or is it?? Anyway it's not working yet, when I close my browser and visit my site again I'm logged out :(, any ideas on what I need to change??

Thanks in advance!
lecterror :: 10.03.2008 03:23:31
Hi, actually, the random string should be OK because the cookie is encrypted. Did you check your browser settings? It should keep the cookies until they expire. Also, is cookie system _sometimes_ works a bit weird: it doesn't log you in at first and you need to refresh the page (don't know the cause yet).
Jelmer :: 10.03.2008 10:00:48
Thanks for the reply, I've done some more testing using more simple cookie->write and read examples. I've found out that cookies are working, they are hashed but not stored in cakephp = "random value" so I'm pretty sure that the cookie I'm trying to set in the users login action isn't working right??

Maybe you could contact me to have a look at my code if you have some spare time, for now I'll try some more and see what I can come up with, any help would be appreciated though!

btw, maybe you could adjust your comments a bit so line breaks are displayed, comments can become a bit hard to read like this.