Zend Framework

Some problems with Zend_Application_Resource_Session using with Zend_Config_Ini and PostgreSQL

Details

  • Language:
    English

Description

Hello

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

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"

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

For Example:

resources.session.saveHandler.options.primary.sessionId = "session_id"
resources.session.saveHandler.options.primaryAssignment.sessionId = "sessionId"

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:

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)
);

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):

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:

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

Best regards!

PS: I'm really sorry for my English.

Issue Links

Activity

Hide
Gabriel Baez added a comment -

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

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

Show
Gabriel Baez added a comment - I have the same problem, but I use an xml configuration. http://framework.zend.com/issues/browse/ZF-8217
Hide
Gabriel Baez added a comment -

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

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

Show
Gabriel Baez added a comment - I have the same problem, but I use an xml configuration. http://framework.zend.com/issues/browse/ZF-8217
Hide
Ramon Henrique Ornelas added a comment -

Reassigned to @Freeaqingme

Show
Ramon Henrique Ornelas added a comment - Reassigned to @Freeaqingme
Hide
Ramon Henrique Ornelas added a comment -

Fixed with r23177

Show
Ramon Henrique Ornelas added a comment - Fixed with r23177

People

Vote (1)
Watch (6)

Dates

  • Created:
    Updated:
    Resolved: