CSC309

Final Exam Preparation

Some notes


Week 1 Lecture

We covered the role of the browser and server. Covered basic HTML5, including the structure of an empty, valid HTML5 document and what the pieces mean. We also covered many basic elements, including block vs inline rendering of elements, DIV and SPAN. We discussed some aspects of the http protocol and the pieces of a URL, that http is a protocol, usually listened to by servers running on port 80. We briefly demoed the http protocol by telnetting into a server and so explained the pieces of a standard URL. We also explored the difference between relative and absolute links. We even thought about image tags and what this means with respect to a single webpage with images and the number of requests a browser might have to make to servers to render the page.

Week 1 Lab

We covered forms, basic form inputs (text boxes, buttons, submit, reset (in the exercises), combo/list boxes, ...), labels, element id, url encoding and how the server receiving the form understands the form variables (QUERY_STRING and STDIN in CGI). The difference between POST and GET as far as CGI is concerned. We set you up on our server, discussed unix permissions briefly, how the apache server is run under account www-data, and the implications for your files. We discussed how the URL gets translated to a request for a particular file. Finally, you created two webpages, validated them and submitted your work.

Week 2 Lecture

Today we covered php, more than just the basics, as well as a good bit about the http protocol, saw headers and the body, that http is stateless and connectionless, we discussed how to add state with cookies and what cookies are, that they can have lifespans, and that they are returned to the site that created them, within certain URLs (if specified). I demoed telnet/nc to a web server and issuing http requests. We showed, in a telnet session cookies being set and being sent. Highlights for php, include $_REQUEST and the interaction with URL encoded attribute/value pairs and forms, $_SESSION, $_COOKIE dictionaries, looping, variables, the general role of PHP etc. I demoed all of the details behind how PHP sessions are implemented, including security implications and demoed session hijacking at a low level. I even touched on file locking and serialization of data, both through var_export and via json. We finished with a demo of a script which shares json data between many clients via shared access to a file. We also spoke about the security implications of php scripts running as root, www-data, or the owner of the script that is executing. We are running suphp (the last option) in our server, so this has implications as to where the php sessions are stored.

Week 2 Lab

Week 3 Lecture

We reviewed a small web framework in class. Concepts included Model, View, Controller. The Controller implemented as a Front Controller (so all requests go through that), There were two states to consider, the model state and the application state. The model state was kept in model variables, the application state was kept in a state variable (also in the session). Also, the Controller used a finite state machine to manage the transitions in application state. We covered how to determine if a submitted page was old via the use of a page state token. We also covered pre-filling/refilling form variables.

Week 3 Lab

Assignment 1

Week 4 Lecture

Week 4 Lab

Week 5 Lecture

Week 5 Lab

Week 6 Lecture

Week 6 Lab

Assignment 2

Week 7 Lecture

Week 7 Lab

Week 9 Lecture

Week 9 Lab

Week 10 Lab

Assignment 3

Week 11 Lecture

Week 11 Lab

Week 12 Lecture

Just some interesting things