diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 13a36070e..22ce1f2cd 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,6 +1,3 @@ # Be sure to restart your server when you modify this file. - -#Rails.application.config.session_store :cookie_store, key: '_tess_sessions' -Rails.application.config.session_store :active_record_store, key: '_tess_sessions', secure: Rails.env.production? - - +opts = Rails.env.production? ? { same_site: :strict, secure: true } : {} +Rails.application.config.session_store :cookie_store, **opts diff --git a/db/migrate/20240702175333_drop_sessions.rb b/db/migrate/20240702175333_drop_sessions.rb new file mode 100644 index 000000000..2dca9868f --- /dev/null +++ b/db/migrate/20240702175333_drop_sessions.rb @@ -0,0 +1,16 @@ +class DropSessions < ActiveRecord::Migration[7.0] + def up + drop_table :sessions + end + + def down + create_table :sessions do |t| + t.string :session_id, null: false + t.text :data + t.timestamps + end + + add_index :sessions, :session_id, unique: true + add_index :sessions, :updated_at + end +end diff --git a/db/schema.rb b/db/schema.rb index 30fd7dfaf..195920c2f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -451,15 +451,6 @@ t.string "title" end - create_table "sessions", force: :cascade do |t| - t.string "session_id", null: false - t.text "data" - t.datetime "created_at" - t.datetime "updated_at" - t.index ["session_id"], name: "index_sessions_on_session_id", unique: true - t.index ["updated_at"], name: "index_sessions_on_updated_at" - end - create_table "sources", force: :cascade do |t| t.bigint "content_provider_id" t.bigint "user_id"