spacey has asked for the wisdom of the Perl Monks concerning the following question:

Hello All,
After much struggling and confusion I have final got Apache::AuthCookieDBI working on mod_perl.....
Unfortunately I found the notes that come with Apache::AuthCookieDBI confusing and incomplete.
If they had contained just a little hint/foot note covering the two points I mention below then I would have saved hours of frustration.
However now that I have got the code to work.
I take my hat of to “Jacob Davies” for an excellent peace of code.

Hopefully this information may help somebody going though the same headache.

The biggest stumbling block was that IE 6 (grr Microsoft) would not interpret the header that’s passed to it when using the example code.
So you end up seeing the html output as text and not the form you expect to see.
I finally found and explanation berried in a deep and dark forum :)
And encase anybody else is struggling, the answer is to add

 $r->content_type("text/html");

Just above the send_http_header line at the end of the code. Also If you struggle to get Apache::AuthCookieDBI to send the actual cookie make sure if you're on an https (ie mod_ssl) that you add
"PerlSetVar WhatEverSecure 1"
to your httpd.conf file or .htaccess whichever is appropriate.

NOTE: only add this line if your on https. Well I hope the above information helps somebody?
I’d like to point out that the above comments are based on my own experience of configuring AuthCookieDBI and as such are just the opinion of one person(me).

Now to my current problem,
Having logged into the site via the login form.
How do i issue a logout?
I’ve studded the AuthCookie help notes on login out but unfortunately i can’t find the right syntax for AuthCookieDBI.

Any suggestion or comments gratefully received.... good or bad

kind regards
Gareth

Replies are listed 'Best First'.
Re: AuthCookieDBI questions and answers
by fuzzyping (Chaplain) on Aug 02, 2004 at 11:15 UTC
    How do i issue a logout?

    I don't use AuthCookieDBI, but generally whenever you want to logout a user that's logged in with cookies, you do two things: 1) reset their cookie to a new value, and 2) redirect them to an "entry" page.

    You should be able to figure out the rest. :)

    -fp
      Thank you “fp” for your answer.
      Unfortunately I should have been more succinct with my description of the problem.
      I except that to log a user out you would follow one of the two suggested path.
      Most likely removing the session cookie.

      I guess my question should have been what syntax would I issue to remove the cookie or issue a bad session key against the username in AuthCookieDBI??
      AuthCookie gives and example of:-
       "$r->auth_type->logout($r);"

      If my understanding is correct this poisons the session. So the next request to authorize will redirect to the login page.
      So is there such a command for the modified AuthCookieDBI??

      Again thanks to one and all
      Gareth