Issues

ZF-6868: Some problems with Zend_Application_Resource_Session using with Zend_Config_Ini and PostgreSQL

Description

Hello

I read documentation for Zend_Application_Resource_Session and I have some problems with configuration present in Example 4.6.

{quote} resources.session.saveHandler.options.primary.session_id = "session_id" resources.session.saveHandler.options.primary.save_path = "save_path" resources.session.saveHandler.options.primary.name = "name" resources.session.saveHandler.options.primaryAssignment.sessionId = "sessionId" resources.session.saveHandler.options.primaryAssignment.sessionSavePath = "sessionSavePath" resources.session.saveHandler.options.primaryAssignment.sessionName = "sessionName" {quote}

In this section the names of the primary and primaryAssignment keys must be the same.

For Example: {quote} resources.session.saveHandler.options.primary.sessionId = "session_id" resources.session.saveHandler.options.primaryAssignment.sessionId = "sessionId" {quote}

If the names of the keys will be different, there are problems with the Zend_Session_SaveHandler_DbTable class file between the line of 525 and 557.

That's not all... Following problems occur when I use the PostgreSQL database.

I created the following database table:

{quote} CREATE TABLE "session" ( session_id character(32) NOT NULL, modified integer NOT NULL DEFAULT 0, lifetime integer NOT NULL DEFAULT 0, data text, CONSTRAINT session_session_id_pk PRIMARY KEY (session_id) ); {quote}

In this case I had to add the following line to the configuration file (because Zend_Db_Table_Abstract try read nextval from no existing "session__seq" sequence):

bq. resources.session.saveHandler.options.sequence = Off

Now the problem is that the variable "sequence" is a string (string(0) "") and in this case the application throws exception. In file Zend/Db/Table/Abstract.php the if-statement on line 939 will be executed (It shouldn't be executed).

The following configuration solved this problem:

{quote} resources.session.saveHandler.options.primary.0 = "session_id" resources.session.saveHandler.options.primary.1 = "save_path" resources.session.saveHandler.options.primary.2 = "name" resources.session.saveHandler.options.primaryAssignment.0 = "sessionId" resources.session.saveHandler.options.primaryAssignment.1 = "sessionSavePath" resources.session.saveHandler.options.primaryAssignment.2 = "sessionName" resources.session.saveHandler.options.sequence = Off {quote}

Best regards!

PS: I'm really sorry for my English.

Comments

I have the same problem, but I use an xml configuration.

http://framework.zend.com/issues/browse/ZF-8217

I have the same problem, but I use an xml configuration.

http://framework.zend.com/issues/browse/ZF-8217

Reassigned to @Freeaqingme

Fixed with r23177