M
M
multifinger2012-03-23 17:21:04
symfony
multifinger, 2012-03-23 17:21:04

Storing sessions in Symfony 1.4 DB sfPDOSessionStorage?

I set up session storage in the database, here is the config:

storage:<br/>
 class: sfPDOSessionStorage<br/>
 param:<br/>
 db_table: sf_sessions<br/>
 database: doctrine<br/>
 db_id_col: sess_id<br/>
 db_data_col: sess_data<br/>
 db_time_col: sess_time<br/>

Everything would be fine, but when sfUser->setFlash() is set, the session is reset, or rather, all the attributes of the session, and when I try to access the sfuser methods, I get a fatal with an explanation that the method of a non-existent object was called.
Who faced or can share guesses? How to set up session storage in Symfony database?

Answer the question

In order to leave comments, you need to log in

11 answer(s)
M
MuXaJIbI4, 2012-03-23
@MuXaJIbI4

I don’t remember what it was connected with anymore ... because right now I’m using symphony version 2 ... but in old projects it was like this And the mySessionStorage.php class itself
storage:
class: mySessionStorage
param:
session_name: soccer
db_table: session
database: main
regenerate: false

<?php
/**
* Adds option for turning off regenerate session id
*
* parameters: see sfSessionStorage
*
* @package symfony
* @subpackage storage
* @author Mathew Toth <[email protected]>
* @author Fabien Potencier <[email protected]>
* @author Sean Kerr <[email protected]>
* @author Sergei Miami <[email protected]>
* @version SVN: $Id$
*/
class mySessionStorage extends sfPDOSessionStorage
{
public function initialize($options = array())
{
// add 'regenerate' option, that is true by default in symfony
$options = array_merge(array(
'regenerate' => true,
), $options);
// initialize the parent
parent::initialize($options);
}
public function regenerate($destroy = false)
{
if ( (bool) $this->options['regenerate'] === true)
{
return parent::regenerate($destroy);
}
}
}

G
Grigory Peretyaka, 2013-12-21
@Peretyaka

You don't need to post. You need to look for reviews about the company and add your experience.

E
Evgeniy Potseluev, 2013-12-21
@evgeniypotseluev

Worth it, why not.

I
Ilya Grom, 2013-12-21
@Gromobanan777

The story must be told. "Information security", "Server administration" and.. "Closet" come to mind.

D
Dmitry Guketlev, 2013-12-21
@Yavanosta

No, it doesn `t need.

S
Stepan, 2013-12-21
@L3n1n

For the publication of this, it is quite realistic to get a ban on Habré.
Habr is not a plaintive book.
Look for other options..

E
Eugene, 2013-12-21
@Nc_Soft

Leatherweb?

N
niXman, 2013-12-21
@niXman

is that the name of the office? if yes, then no. I will reveal the name of the office in the publication.

E
EvilMushroom, 2013-12-22
@EvilMushroom

It's not worth it

I
Ilya Evseev, 2013-12-22
@IlyaEvseev

For such reviews there is forum.searchengines.ru/forumdisplay.php?f=37

S
svd71, 2013-12-22
@svd71

On the subject of a refund. Try sending your screenshots with comments to hosters in Germany.
I had similar questions, only on a different topic. The decision was made in such a positive way. According to the laws of Germany, if an employee misled the client and there is evidence of this, then the transaction is considered invalid.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question