Home Work Assignment 14 (due 12 Apr 2019)

Cookies

Various online newspapers have a welcome page that provides a list of links to news stories. When you click on a link it brings up a login page and a link to a registration page for a new user. When you have either logged in or registered you can read that news item or any other item on the welcome page. If you subsequently visit that online newspaper from the machine you logged in or registered you will not be asked to login again. Whereas, if you are at a new machine you will be prompted to login.

Invent a name for your newspaper and five headlines. You will have five html pages corresponding to those links and they could have just a sentence or two regarding the story. User name and password are colon delimited and in a text file called passwd. For a new user the username has to be unique but not the password. New username and password are appended to this file. The welcome page for the newspaper does not have to look professional. It could be just a headline with five bulleted headlines. Make sure that your application logic works!

Once a user logs in, the application should send a cookie to the client machine that expires in 2 minutes for testing purposes. If the user subsequently visits the page then he / she does not have to login again. The user can click on any headline and get the full story without logging in.

After you complete your PHP script add the information to the table that you created in your index or welcome page. We should see your links before 11 pm on Friday, 12 Apr 2019.