MidtermDue Saturday April 28 at NOONNEW 04/19: script illustrating cookies, file access, and simple authentication This script illustrates concepts that you'll use on the midterm, and you are free to take it, study it, and modify it. You are not required to solve the midterm using any techniques from this script, but I thought you'd find it helpful. (by the way, the secret word is in the top comment in the Perl source code) For the midterm, you will build a web-based persistent birthday tool. It will let users sign up for an account, and it will save a birthday for them. See it running. Feel free to create accounts and update birthdays! You should build your script so that it mimics the behavior of my script. It does not have to look exactly like mine, but it will have the following states: login page, login page with login failure (bad username and/or bad password), login page after user clicks "logout", new user signup page, new user signup page with errors (password had spaces in it or was not 2-12 characters long, no first/last name, username already exists, passwords don't match), show birthday page, and show birthday page with an updated birthday. Store the user info in a flat text file or Berkeley db. Do not store the raw password--instead store the SHA1 digest of the password. You will implement cookie authentication. When the user successfully signs in (or successfully creates a new account), set cookies. When the user clicks "logout", clear the cookies. info on cookies, SHA1, and authentication Extra Credit If you're using a flat text file (I did) or a Berkeley DB file, you should consider the implications of multiple users accessing the data source at the same time. That is, what if multiple users try to update their info at the same time? The data file could get out of sync, or corrupted. You should implement locking, so that only one user can perform a write operation at a time. Lock.pm | ||
|
UW Extension Perl Programming Course Three, Perl, the Web, and Databases March 26 - June 04, 2007 (note no class May 28) Monday evenings 10 Sessions, 6:00 to 9:00 PM Instructor: Joel Grow (joelg at u.washington.edu) |
links: perl.com cpan perldoc online learn.perl.org perlmonks.org seattle perl users group (spug) |
|
|
Thursday, May 24, 2012 you're number: 798 | ||