Skip to content

Instantly share code, notes, and snippets.

@zackham
Created July 15, 2010 03:10
Show Gist options
  • Save zackham/476446 to your computer and use it in GitHub Desktop.
Save zackham/476446 to your computer and use it in GitHub Desktop.
if cookies['_old_cookie_name']
redis = Redis.new
val = redis.get cookies['_old_cookie_name']
if val
old_session = Marshal.load val
old_session.each{|k,v| session[k] = v}
redis.incr 'migrated_sessions'
end
cookies.delete '_old_cookie_name'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment