Cookieの有効期限を延ばす
class ApplicationController < ActionController::Base ... after_filter :set_session_expires ... private def set_session_expires cgi = request.instance_variable_get(:@cgi) output_cookies = cgi.instance_variable_get(:@output_cookies) if output_cookies and (cookie = output_cookies.first) cookie.expires = Time.now + 1.month end end ... end
セッションを無効にする
session#deleteは実装依存のよう。mem_cache_store.rbには実装されてた。
class AuthController < ApplicationController ... def logout disable_session ... end private def disable_session session.delete cgi = request.instance_variable_get(:@cgi) output_cookies = cgi.instance_variable_get(:@output_cookies) if output_cookies and (cookie = output_cookies.first) cookie.expires = Time.now - 1.month end end ... end