Details
-
Type:
Docs: Problem
-
Status:
Resolved
-
Priority:
Trivial
-
Resolution: Fixed
-
Affects Version/s: 1.8.2
-
Fix Version/s: 1.11.0
-
Component/s: Zend_Application, Zend_Config, Zend_Session
-
Labels:None
-
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
| This issue depends on: | ||||
| ZF-8636 | Zend_Session with saveHandler db and Multi-Column Primary Key |
|
|
|
| This issue duplicates: | ||||
| ZF-7000 | Zend Application Resource Session error |
|
|
|
| This issue is duplicated by: | ||||
| ZF-9599 | Error with configuration based on the example using Zend_Session_ |
|
|
|
| ZF-10471 | Zend_Application_Resource_Session application.ini example is incorrect |
|
|
|
I have the same problem, but I use an xml configuration.
http://framework.zend.com/issues/browse/ZF-8217