Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 142 Lecture Notes: Cookies

Similar presentations


Presentation on theme: "CS 142 Lecture Notes: Cookies"— Presentation transcript:

1 CS 142 Lecture Notes: Cookies
Cookie Protocol Server sets cookies in response header: Set-Cookie: session=0x4137f; Expires=Wed, 09 Jun :18:14 GMT Browser returns cookies in headers of later requests: Cookie: session=0x4137fd6a Name Value Expiration Time CS 142 Lecture Notes: Cookies

2 CS 142 Lecture Notes: Cookies
Easter Egg Controller class RailsIntroController < ApplicationController def hello @warning = false if session[:count] == nil then session[:count] = 0 end session[:count] = session[:count] + 1 if (session[:count] >= 3) then @warning = true ... CS 142 Lecture Notes: Cookies

3 CS 142 Lecture Notes: Cookies
Easter Egg View = "Hello, User"%> <p> This page was fetched at <%= Time.now() %> </p> <% %> <b>HEY!</b> Don't you have anything better to do than just redisplaying me over and over? <% end %> CS 142 Lecture Notes: Cookies

4 CS 142 Lecture Notes: Cookies


Download ppt "CS 142 Lecture Notes: Cookies"

Similar presentations


Ads by Google