Re: Persist auth over multiple pages
| From: | Jon Wood | Date: | Thu, 01 Jul 2004 09:49:38 +0000 |
| Subject: | Re: Persist auth over multiple pages | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-13433@lists.php.net to get a copy of this message | ||
On Wed, 30 Jun 2004 01:19:38 -0700, Bjorn <bhansen@uvic.ca> wrote:
>
> Hey,
>
> what's the right way to get a reference to the Auth object for pages
> which are not login pages? It seems like I should not have to make a
> connection to the database and create a new Auth on every page if All I
> want to do is call getAuth().
>
The best way is to create a new Auth object for every page - while
this does cause some extra load, it also ensures that any changes to
how the data is stored in the session won't cause your site to stop
working.
I believe (although you'll need to check the docs) that if you want to
reduce the number of times your connecting to the database you can
pass a PEAR_DB object to the Auth constructor instead of a DSN, and it
will use that instead.
Jon
> Bjorn
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>