Created
March 17, 2010 23:27
-
-
Save biilmann/335854 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CookieTestController < ApplicationController | |
def set_cookie | |
cookies.delete :hello | |
cookies[:hello] = { :value => "Hello there at #{Time.now}!", :expires => 2.weeks.from_now } | |
render :text => "cookie set to: #{cookies[:hello]}" | |
end | |
def view_cookie | |
render :text => "Cookie: #{cookies[:hello]}" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET /set_cookie | |
cookie set to: Hello there at Thu Mar 18 00:27:07 +0100 2010! | |
GET /view_cookie | |
Cookie: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment