Re: Usefulness of $r->notes and $r->pnotes (or $c)

Douglas Sims <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
We use the notes table to put a reference to the session (and thus the user)
in the access log.

$request->notes->set('session' => $session->{SESSION});

This is in apache2.conf:

  LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\" %{session}n" combined_with_session

This makes it possible to differentiate log entries by user, whether
multiple users have the same ip address or if a user's address changes.



On Tue, Mar 23, 2010 at 4:28 PM, Michael Ludwig <[email protected]> wrote:

> Let me bore you some more.
>
> First, ModPerl::MethodLookup::lookup_method( $symbol ) is a really great
> help for exploring the API!
>
> milu@colinux:~ > perl aplkp.pl notes
> There is more than one class with method 'notes'
> try one of:
>        use Apache2::RequestRec ();
>        use Apache2::Connection ();
>
> milu@colinux:~ > perl aplkp.pl pnotes
> There is more than one class with method 'pnotes'
> try one of:
>        use Apache2::RequestUtil ();
>        use Apache2::ConnectionUtil ();
>
> Good. Now to the point. We have ->notes and ->pnotes on the request and
> connection objects. I've passed some information from mod_perl on to
> mod_php5 using the notes table. Cool. I could pass complex data from one
> mod_perl handler to the other using the pnotes table. Also cool.
>
> It's all in-process, which is cool. It's all per-request (or, if you
> want, per-connection), which sets the scope of its usefulness.
>
> The notes are an APR::Table, the pnotes are a HASH.
>
> What real-life uses have you found for these notes and pnotes?
>
> What could be done at the connection level? Or is this rather too
> low-level for run-of-the-mill web applications?
>
> This is by curiosity and to get my imagination going.
> --
> Michael Ludwig
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.