---
title: "在db中记录session"
author: "yinter"
date: "2008-03-31T13:49:37Z"
tags: []
slug: "db-session"
draft: false
lastmod: "2008-03-31T13:49:37Z"
id: 178029
url: "https://yinter.iteye.com/blog/178029"
---

在rails中用数据库记录session，其它很简单：
rake db:sessions:create
rake db:migrate

然后，把environment.rb中的config.action_controller.session_store=:active_record_store改为启用状态即可，默认的session存储机制是基于文件系统的。