Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
No, not the kind you dunk in milk. Browser cookies are little bits of data that your browser lets sites store on your computer. We'll use them to store all of the user's choices for their bear. Let's see how to store information in a cookie for later retrieval.
The JSON library docs. 99% of the time, you won't need anything more than .loads()
and .dumps()
.
New Terms
Response: A response is the data that the server, Flask, sends back to the client.
make_response()
: This function generates the entire response object that'll be sent back to the client, but lets you store it in a variable for further manipulation.
response.set_cookie()
: Sets a cookie on the response object. Takes name for the cookie and a value.
json.dumps()
: This method turns a Python data structure (list, string, dictionary, etc) into a JSON string.
json.loads()
: This method turns a JSON string into a Python object.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
William Shaylor
3,015 Points1 Answer
-
Alan T.
4,784 Points1 Answer
-
Kortney Field
14,091 Points0 Answers
-
Ayman Said
Python Web Development Techdegree Student 14,717 Points1 Answer
-
Youssef Moustahib
7,779 Points4 Answers
-
Junior Mateus
2,784 Points0 Answers
-
eyeloveotters
15,097 Points1 Answer
-
annecalija
9,031 Points1 Answer
-
Marta P.
2,849 Points3 Answers
-
dojewqveaq
11,393 Points7 Answers
-
john larson
16,594 Points1 Answer
-
john larson
16,594 Points0 Answers
-
Brian Patterson
19,588 Points1 Answer
-
Sai Krishna Teja
1,747 Points4 Answers
-
Jeremy Bradrick
6,731 Points2 Answers
-
Suneet Badoni
4,515 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up