Eeyore here, again, less happy than ever. S.O.S.

okay. i try to use the Ticket*.pm modules from the book
(chapter 6) verbatim and they work well for well-behaved
browsers.

to widen the workability (i.e. to make it functional for
badly-mannered browsers*) i'm trying some workarounds.

this is a PerlAccessHandler, which should check for the existence
of a cookie in the incoming headers, and if not there (or
expired) it should redirect the browser to a login area that
takes name/password pair, and if valid, would then return the
browser to the original URL. to do that, as we issue the
'redirect to the login area' we set a cookie containing the URL
to return to.

problem: some browsers see 'redirect' and ignore all other
headers, so the cookies aren't set. when the browser arrives at
the login area, there's no cookie to send there, to formulate
a return-to address from.

man CGI says 'we don't do http-equiv "meta" headers because you
can do those in header_out instead'. what's the politically
correct way to do this?

this also doesn't work (PerlAccessHandler)-- what would need to
be bent to make this function properly?

        my $ticketTool = Apache::TicketTool->new($r);
        #...
        my $cookie = $ticketTool->make_return_address($r);
        # (so we can get back to where user wanted to be)

        my $login_uri = $r->dir_config("TicketLogin");
        # instead of book's "ErrorDocument 403" example

        use CGI '-autoload';

        # note: PerlAccessHandler
        print
                header(-refresh => "1; URL=$login_uri", -cookie => $cookie),
                start_html(-title => 'Redirecting to login', -bgcolor => 'white'),
                h1('Please log in'),
                p("You're being redirected to ",
                        a({-href=>$login_uri},$login_uri),
                                " in just a moment."),
                h2("Please stand by..."),
                end_html();
#       return .... WHAT?

* note that the manners-ability of the browsers, being the
  problem, is something i'm accepting on faith. if there's
  another explanation (with a workaround that i might have a
  chance at understanding) i'd love to hear it.

-- 
don't visit this page. it's bad for you. take my expert word for it.
http://www.salon.com/people/col/pagl/2001/03/21/spring/index1.html

[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

Reply via email to