Raspberry_Pi_Education_Manual

Notes:

When using this program, you will notice that the value of the cookie is remembered even if you close the web browser.

How does it work? First, we display the current value of the cookie. If the “cookiechange” variable is set, the value of the cookie is changed and this is sent back to the web browser to store. The cookie has a maximum age though – we have used 30 days in this example. The cookie may be lost even sooner if it is deleted by the user in the web browser. The web browser may even be set up to ignore cookies completely and never store them, although this is not usually the case.

Further reading

More information about the “WebOb” library can be found at http://docs.webob.org/en/latest/

There are also several Python web frameworks available that do a lot of the work for you. A framework is recommended if you are thinking about writing an entire website. A popular example is the Django framework; see http://www.djangoproject.com/

We have only given a very small taster of what is possible here – there is a huge amount that can be learned about writing web applications.

Human-computer interfacing

124

Made with FlippingBook flipbook maker