On Mon, 11 Feb 2002, Negrea Mihai wrote: > I've been playing with midgard trying to do a form authentication. > after the user sends the user and the password I call > mgd_auth_midgard($username, $password, true) so that a cookie will be sent to > the browser and user will be authenticated. > I call this function from the ROOT element but before any output is sent to > the browser. > If the username and password are correct the functions returns true and sets > the required cookie but the midgard object does not get updated (the > $midgard->user is still set to 0 and i've been trying to authentifie with uid > 5)
The $midgard object is filled upon startup of the page, but not automagically updated after calling mgd_auth_midgard. After a successful mgd_auth_midgard you should call: $midgard = mgd_get_midgard(); and you should be fine. Do note Piotras' objections agains storing the cookie, I think they are valid. wkr, -- Envida http://www.envida.net/ Armand A. Verstappen Graadt van Roggenweg 328 [EMAIL PROTECTED] 3531 AH Utrecht tel: +31 (0)30 298 2255 Postbus 19127 fax: +31 (0)30 298 2111 3501 DC Utrecht --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
