Please click here to view a short screencast outlining my formatting for Assignment 3.
The shopping cart will be a separate page that the user can visit by clicking on the shopping cart icon atop all of the product pages. The user will be able to edit quantities on this page, as well as see their current subtotal (not including tax or shipping costs). Users do not need to be logged in to view or edit their cart; however, they will be redirected to the login page if they attempt to checkout and go to the invoice.
The shopping cart data that will be stored in the session will be done so in an array. Since we reformatted our products to be three separate arrays contained within one JSON object, the session will reference an individual item through their respective array format. For example, {Boxes:[1, 1, 1, 0, 0, 0], Boosters:[1, 1, 1, 1, 1, 1], Accessories:[0, 0, 0, 1, 1, 1]}. This way, I will be able to tell if the user has picked out quantities for the respective array, and the individual object in each array. Although this is the format I expect to use, if this does not work, I could always refer to the object in its entirety within the array, specifying the quantity, name, etc. From there, I could push new quantities into this stored session array/pop off the last item if removed, in order to keep an updated shopping cart.
As we did in the last lab, we are able to validate log in status through the use of cookies generated by the server and sent to the client. Our client pages are able to check and validate to ensure each visitor has received a cookie from the server, verifying their login. A security concern regarding cookies is that since they are sent to the client to be used, they can also be manipulated in order to fulfill whatever tests are being conducted using said cookie.
Upon logging in, each product page on my website will say “username’s” cart. The user will also be greeted by their name when arriving at the invoice, and will also be personally thanked after completing their purchase. In Assignment 2, I was able to complete parts of this challenge by converting the object for the users name into a string, and passing it through the query string. This query string would then be sent to following pages, where this data could be used to generate personalized messages. For this assignment, I am thinking of using sessions and pulling the name object for each user out of their individual session. I will most likely leave the shipping address in the query string, as it is submitted as a form on the confirmation page.
I am not working with a partner.
Assignment 2 built upon Assignment 1, as we were still tasked to use the query string to pass data between pages, in order to be manipulated and used; however, with Assignment 3, we are required to use cookies and sessions to accomplish similar tasks. Because of this, I expect to do much more learning on my own through online resources, since we did not practice these concepts in too great of detail both in the lab, nor previous assignments