Snippets

Create an account or login to be able to add, comment and rate snippets.

Navigation

Change session storage

By default, symfony stores user sessions in files.

You can store them in your database by changing your apps/APPNAME/config/factories.yml configuration file:

all:
  storage:
    class: sfMySQLSessionStorage
    param:
      database: propel
      db_table: SESSION_TABLE_NAME

There are several available session storage classes:

The API documentation lists all available configuration parameters.

by Fabien Potencier on 2006-05-21, tagged database  session 

Comments on this snippet

gravatar icon
#1 Dustin Whittle on 2006-05-22 at 07:19

You can alsoe change the session/table names if you do not like the defaults:

storage: class: sfCreoleSessionStorage param: database: propel session_name: symfony db_table: sessions db_id_col: id db_data_col: data db_time_col: updated_at

You need to create an account or log in to post a comment or rate this snippet.