Emiliano <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED].
..
> > > It basically lists all pages under the rootpage, accept for the nomenu
> > > page. This used to work fine, until I started to use
> > > mgd_auth_midgard("username","password",1) somewhere else in the site.
> > > Now it just works when someone is logged on (received a auth_cookie),
> > > but when that cookie is reset,  mgd_list_pages(140) above will not
> > > return an object. Before I started playing with logins $midgard->user
> > > always was 0, and there where no problems, now when someone is not
> > > logged in $midgard->user is 0 too.
>
> mgd_auth_midgard(....,1) must be used before any page content is output,
> since it will send a cookie in the headers. This may be related to your
> problem. Another issue could be that after the mgd_auth_midgard you may
> have logged yourself out and fail to fetch things because of that.
>
Yes, I figured that one out, and actually committed a comment about it to
CVS. But my probs started after that.

> > I am using mgd_auth_midgard("=","",1) to 'unlogin' a person. This
> > results in the user sending a cookie that does not succesfully
> > authenticate. Because of that Midgard apparently decides to not allow me
> > to perform the mgd_list_pages function.
> > Is there a way to remove the users cookie?
>
> To forcibly remove the cookie, use mgd_auth_midgard("","",1), which will
> anonimize the currently logged in user and send a cookie to that effect to
> the users' browser. The cookie won't be deleted, though.

I tried both mgd_auth_midgard("","",1) and mgd_auth_midgard("=","",1), but
both did not give the desired result. I fixed this by sending a Set-Cookie:
header in which I reset the expiration date to a date in the past. This gave
me the desired results. Since I had to read the source to find out how the
cookie is set (Netscape is very precise about receiving the exact cookie
information), it may be a good idea to add a function that does the same,
mgd_auth_midgard_delete(void); . Also, I noticed that mgd_auth_midgard
doesn't send the domain with the cookie. I may be wrong, but I think this
could cause problems if I have www.blah.com in sitegroup 1 and
www.blah.com/sub
in sitegroup 2, because the path is set to '/' .

Armand.



--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]

Reply via email to