Project

General

Profile

« Previous | Next » 

Revision 085f01eb

Added by Marc Dequènes over 15 years ago

  • ID 085f01ebd4a3bce01cadfc267a82ce593ff6feb8

[evol] use SQL sessions instead of cookies-based ones

View differences:

app/controllers/application.rb
# See ActionController::RequestForgeryProtection for details
# Uncomment the :secret if you're not using the cookie session store
protect_from_forgery # :secret => '86f01f14fc184c81bf152965a2bccb88'
protect_from_forgery :secret => MyCyma::Config.instance.session_secret
filter_parameter_logging :password
config/environment.rb
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rake db:sessions:create")
# config.action_controller.session_store = :active_record_store
config.action_controller.session_store = :active_record_store
# Use SQL instead of Active Record's schema dumper when creating the test database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
config/settings.yml
---
site_name: Cimaise Bonicoli
#image_preview_frame: "100x100"
max_uploaded_image_size_mb: 10
thumbnail_sizes:
small: "100x100>"
big: "400x400>"
db/migrate/20090411170814_create_sessions.rb
class CreateSessions < ActiveRecord::Migration
def self.up
create_table :sessions do |t|
t.string :session_id, :null => false
t.text :data
t.timestamps
end
add_index :sessions, :session_id
add_index :sessions, :updated_at
end
def self.down
drop_table :sessions
end
end
db/schema.rb
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 0) do
ActiveRecord::Schema.define(:version => 20090411170814) do
create_table "artwork_conditions", :force => true do |t|
t.string "name", :limit => 64, :null => false
......
add_index "exhibitions", ["name"], :name => "nom", :unique => true
add_index "exhibitions", ["name"], :name => "nom_2"
create_table "sessions", :force => true do |t|
t.string "session_id", :null => false
t.text "data"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
create_table "users", :force => true do |t|
t.string "login", :limit => 64, :null => false
t.string "real_name", :limit => 256

Also available in: Unified diff