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.
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
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller ileniamaiettabusiness. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for £6.56. You're not tied to anything after your purchase.