Hi,
I tried to enable session storage in an Oracle Database in a test project as follows:
all:
storage:
class: sfPDOSessionStorage
param:
session_name: oraclesessiontest
db_table: t_session
database: doctrine
db_id_col: id
db_data_col: session_data
db_time_col: time
Database connection is configured correctly and works. Table for session data is defined as follows:
T_SESSION:
connection: doctrine
tableName: T_SESSION
columns:
id:
type: string(32)
fixed: false
unsigned: false
primary: true
session_data:
notnull: false
type: clob(4000)
fixed: false
unsigned: false
primary: false
time:
notnull: true
type: integer(8)
fixed: false
unsigned: false
primary: false
After saving the settings I deleted all items from the cache directory. Now, when I tried to use session data, it did not work. Using Oracle SQL Developer, I can see there is data stored in table T_SESSION, but reading out session data did not work.
The exact same application works fine when I define a MySQL connection instead of an oci connection in databases.yml.
I debbuged a while and found a solution:
Replace line 118 of sfPDOSessionStorage.class.php
return $sessionRows[0][0];
with
if (!is_string($sessionRows[0][0]))
{
return fgets($sessionRows[0][0]); // works for Oracle
}
else
{
return $sessionRows[0][0]; // works for MySQL
}