• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 6 pages
Class notes

Web Programming: Cookies, Sessions and the ORM Lecture Notes

Document preview thumbnail
Preview 2 out of 6 pages

Lecture Notes about cookies, sessions and the object-oriented model, how they work in websites and how to model them in Django. It has a summary section on the left side of the page, following the Cornell note taking method, where the key points are summarised on the side of the noted.

Content preview

3️⃣
Cookies, Sessions and ORM
SUMMARY MAIN NOTES

HTTP is a Contents
stateless HTTP
application-layer HttpRequest Object
protocol. It is Cookies

extensible Session
Cookies
Django uses an Proxies
HttpRequest Object Middleware
containing the Object-Relational Map
details Type Mapping
Field Options
body

method
HTTP
GET/POST
parameters
An application- layer protocol for
Cookies requests and responses sent between
META i.e. client-server.
HTTP headers
Aspects of HTTP:
sessions
simple and human-readable
Cookies are a
small piece of data extensible, easy to introduce new functionality
server sends to a
stateless: no link between two requests being
client. They allow
successively carried out on the same
for web
connection. Could bring problems when trying
applications to
to interact with certain pages coherently, but
store limited
cookies solve that.
amounts of data
and remember
state information
HttpRequest Object


Cookies, Sessions and ORM 1

, e.g. used to Upon an HTTP Request, Django creates HttpRequest

check if a Object containing request details

request is from
Body: raw HTTP request body as a byte string
the same client
method
they can be
used to GET/POST parameters, a dictionary
manage Cookies: dictionary with all cookies
sessions such
META: all variable HTTP headers
as carts,
scores, sign-in session: dictionary with session values (set by
status middleware)

personalisation
such as Cookies
language and
UI A small piece of data a server sends to
track and
a user’s web browser. They allow web
record user applications to store limited amounts of
behaviour data and remember state information
Similarly, a session
uses cookies, but Used to determine if different requests come from
the same client, then generate a personalised or
it used to store
generic response as appropriate. Uses:
information on the
server about a Session management: user sign-in status,
user to be used shopping cart contents, game scores, or any
across multiple other user session-related details the server
pages of the needs to remember
website
Personalisation: user preferences such as
They are display language and UI theme
encrypted
Tracking: recording and analysing user
while users are
behaviour
not

automatically
created and
removed with
💡 Can send cookies through HTTP request
Set-Cookie: <cookie-name>=<cookie-value> . They

opening and can have an expiration date or max age.




Cookies, Sessions and ORM 2

Document information

Study
Unknown
Uploaded on
January 5, 2025
Number of pages
6
Written in
2024/2025
Type
Class notes
Professor(s)
Paulo oliva
Contains
All classes
$9.74

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
10
Last sold
-




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions