PostgreSQL Session Handler for PHP

PostgreSQL Session Handler for PHP is a custom session save handler for PHP4 that uses PostgreSQL as the session cache. This allows multiple Web servers to share a common session storage container, and is useful for allowing Web users to move between machines while maintaining their session state.

Tags Database Internet Web Dynamic Content Software Development Libraries php classes
Licenses BSD Original
Implementation PHP

Tweet this project Short link

Rss Recent releases

  • Rrelease-mid
  •  10 Feb 2003 10:42
  • Rrelease-after

Changes: This release corrects a bug that caused session writing to always return failure. Also, the SQL table schema has been updated to support longer session keys.

  • Rrelease-mid
  •  12 Jan 2003 17:49
  • Rrelease-after

Changes: This is a major rewrite / cleanup of the existing code. In particular, it has been updated to reflect the most recent set of changes to the PHP PostgreSQL API.

  • Rrelease-mid
  •  12 Sep 2002 00:34
  • Rrelease-after

Changes: Session rows are now locked over the lifetime of the session. This more accurately reflects the behavior of the default 'files' session driver and prevents session collisions.

  • Rrelease-mid
  •  30 Jan 2002 23:39
  • Rrelease-after

Changes: Changing the session write implementation to perform the update inside of a transaction block.

  • Rrelease-mid
  •  25 Jan 2002 13:35
  • Rrelease-after

Changes: This release adds a small fix to the read function that improves compatibility with PHP 4.1.0 and greater.

Rss Recent comments

Rcomment-before 22 Feb 2008 16:53 Rcomment-trans merreborn Rcomment-after

Bug in session_write function
The pgsql_session_write function has a flaw -- it relies on pgsql_session_read to INSERT the database row.

While pgsql_session_read() is called before pgsql_session_write() 99.9% of the time, there's one case in which this doesn't happen -- when session_regenerate_id() is called. PEAR_Auth calls this function, rendering it incompatible with this package.

Fortunately, the fix is simple:

add a call to pgsql_session_read($key) to pgsql_session_write().

Rcomment-before 26 Jan 2002 06:04 Rcomment-trans mystran Rcomment-after

Re: Nice

To make my self more clear:

It does update in one transaction, great, but if you happen to be loading two pages with same session at the same time you lose changes by one of them on update. Quick solution might be just to wait until the first page is finished... this may happen with frames and with users browsing with more than one window, especially when the server is a bit loaded or you are doing something slow on one of the browsers..

Rcomment-before 26 Jan 2002 05:59 Rcomment-trans mystran Rcomment-after

Nice
Only that I'd like to rather have session handler as a module (is this possible ?).
Some locking to allow safe clustering would be nice, and enable one to use it for corporate-class applications..

10f42f73468823edf1f156b261a96ad8_thumb

Project Spotlight

Absolute OS

A modified Slackware distro configured for ease of use.

E118f6d89741593f4cb04c6ee6bcfd86_thumb

Project Spotlight

OTRS

A help desk and ITIL compliant IT service management solution.