[imp] IMP and POP3 support

Andrew Morgan morgan at orst.edu
Mon Dec 2 19:52:39 2002



On Fri, 15 Nov 2002, Jon Parise wrote:

> On Tue, Oct 29, 2002 at 02:13:23PM -0800, Andrew Morgan wrote:
>
> > > I've run sessions from an PostgreSQL database for quite a while.  My
> > > handler is located here:
> > >
> > >     http://www.csh.rit.edu/~jon/projects/pgsql_session_handler/
> >
> > I ended up writing a cross between your pgsql session handler and Ying
> > Zhang's mysql session handler.  My version is attached to this message.
> >
> > I have a few questions about your session handler:
> >
> > 1. Doesn't using addslashes($val) on the session write modify the session
> > data?  Does PHP automatically remove the slashes later when the
> > application tries to use the session data?
>
> Good question.  Looking back as the code, I don't actually recall the
> answer (I don't do much database work right now).  I believe the
> addslashes() calls are primary for the database; the slashes aren't
> actually stored, but they keep the SQL query string intact.

Let me just say that you really *must* have addslashes($val) in the
session write function.  I put the mysql session handler into production
this weekend, and several users complained that they could no longer
login.  They got an error that their session was expired.

It turns out that these users had a single quote (') in their signature.
All your imp preferences are copied into the session value as part of the
prefs_cache attribute, including the signature.  Without the
addslashes($val), the write was failing horribly.

Otherwise, it seems to be working great.  Thanks again.

	Andy



More information about the imp mailing list