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

Issue Type: Docs: Problem Created: 2009-05-30T18:02:24.000+0000 Last Updated: 2010-10-20T16:18:42.000+0000 Status: Resolved Fix version(s): - 1.11.0 (02/Nov/10)

Reporter: Piotr Minkina (likemandrake) Assignee: Ramon Henrique Ornelas (ramon) Tags: - Zend_Application

  • Zend_Config
  • Zend_Session

Related issues: - ZF-7000




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" = "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.


Posted by Gabriel Baez (gabrielbaez) on 2009-11-04T10:49:14.000+0000

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

Posted by Gabriel Baez (gabrielbaez) on 2009-11-04T10:52:14.000+0000

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

Posted by Ramon Henrique Ornelas (ramon) on 2010-04-02T17:07:10.000+0000

Reassigned to @Freeaqingme

Posted by Ramon Henrique Ornelas (ramon) on 2010-10-20T10:01:31.000+0000

Fixed with r23177

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.