Skip site navigation (1) Skip section navigation (2)

Difficulties with postgresql based session handlers

From: "G(dot) J(dot) Walsh" <gjwalsh(at)dscdirectionalservices(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Difficulties with postgresql based session handlers
Date: 2008-04-05 22:42:04
Message-ID: 1207435324.559.33.camel@www.dscdirectionalservices.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hello!

I have attempted to install a session handler based on the script laid
out on page 442 of "Beginning PHP and PostgreSQL 8". The script works
correctly in that session info is written to the table. For that reason
I have not listed the script which appears to be in general usage.

BUT .... there are 2 problematic areas.

First: in executing this simple script:
<?php

INCLUDE "pgsessionhandlers.php";
session_start();
$_SESSION{'name'] = "George";

?>

followed by the psql: select * from sessioninfo;

I can 'see' the sessionid and the expiration columns. The third column,
'value' was expected to show: name|s:6:"George";
Instead it shows the text column as 64 character hex.
What am I doing/setting that is causing the column data to NOT be
displayed as plain text? 

Second: Later I discovered to my dismay that phppgadmin will no longer
load. The error log complains 'Failed to initialize storage module,
use(path:/var/lib/php)' and points to the 2 lines:
session_name('PPA_ID'); and session_start(); which are invoked from
within /var/www/phppgadmin/libraries/lib.inc.php because
session.auto_start is off (which is correct). 

I suspect there is some kind of conflict arising from the ini settings
related to postgresql sessions. Session.save_handler was originally
equated to files and sessions were logged there (once I changed the file
permissions to 770). When I set up the postgresql session handlers I
changed this equate to 'users' and that change resulted in the logging
to the postgresql table rather then the file.

Sorry for the wordy explanation. I am just a little tormented by this
latest 'resistance' and perhaps it shows. 

If any of you have been down this road before, I'd appreciate a friendly
hand. It is not a matter of life or death (I can simply scrap the use of
postgresql for session logging, after all) but I am trying to utilize
the db to force my familiarity with ever more aspects of it.

Many thanks.

George
 

pgsql-novice by date

Next:From: Mag GamDate: 2008-04-06 20:25:13
Subject: best practices for dumping databases
Previous:From: John KollerDate: 2008-04-05 03:11:15
Subject: Re: Six processes and why does the service want access to the internet?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group