1/29
Flashcards about web technologies, URLs, HTTP, HTML, CSS, JavaScript, Same-Origin Policy, Cookies, and Session Management.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What are examples of resources on the web?
Webpages, images, PDFs, etc.
What does URL stand for?
Uniform Resource Locator.
What are the three mandatory parts of a URL?
Protocol, location, and path.
What does the protocol part of a URL indicate?
Indicates how to retrieve the resource.
What are some examples of protocols?
http, https, ftp, ssh.
What does the location part of a URL specify?
Specifies where to retrieve the resource from.
What does the path part of a URL indicate?
Which resource on the server to retrieve.
What does the question mark (?) in a URL indicate?
Optional arguments or parameters in a URL.
How are parameters represented in a URL?
Key-value pairs separated by &.
What is the purpose of an anchor (#) in a URL?
Optional marker to put an element in focus, not sent to the server.
What is HTTP?
Hypertext Transfer Protocol, the language browsers and servers use to communicate.
What model does HTTP follow?
Client requests, server responds.
What does the first line of an HTTP request indicate?
Method, location, and version.
What is the difference between GET and POST requests?
GET requests do not change server state, POST requests are intended to change server state.
What are the core elements of a webpage?
HTML, CSS, JavaScript.
What is HTML?
Hypertext Markup Language, allows us to create structured documents.
What is CSS?
Cascading Style Sheets, modifies appearance of HTML.
What is JavaScript?
The language of the web, able to manipulate HTML/CSS via DOM, enables dynamic webpages.
Why is having multiple open webpages a security risk, and what policy mitigates this?
Multiple open webpages pose a security risk, mitigated by the Same-Origin Policy.
What is the Same-Origin Policy?
Browser policy preventing webpages from accessing other open webpages unless they have the same origin.
What determines the origin of a webpage?
Protocol, domain name, and port.
What are the exceptions to the Same-Origin Policy?
JavaScript, images, and frames.
How do browsers and servers store state?
Browsers and servers store state via cookies, which are sent with every request.
What is a cookie?
A name-value pair.
What are the attributes of a cookie?
Domain and Path, Secure, HttpOnly, Expires.
What do the Domain and Path attributes specify for cookies?
Specifies which domains and paths to attach the cookie with.
What does the Secure attribute do for cookies?
Prevents cookie from being sent over an unsecure channel (HTTP).
What does the HttpOnly attribute do for cookies?
Prevents cookie from being read via JavaScript.
What does the Expires attribute do for cookies?
Tells browser to delete the cookie after a timestamp.
How does session management work?
Server generates and sends session token as a cookie, keeping a mapping between users and tokens.