The following below is a checkpoint in my progress for Assignment #3
Screencast Presentation This is a link to my presentation which explains my plans for each page as well as how I will utilize sessions and cookies for Assignment #3.
For my site, I plan on displaying the user’s shopping cart on a separate page through a tab on the right side of the navigation bar. Every page the user visits, they will have access to the cart regardless if they logged in or added any quantities. My shopping cart will allow users to make edits such as deleting a product or all products before checking out. I will also include buttons between the quantities box so that the user can increase or decrease the amount of products they want. This process will use sessions to send the user’s purchases back to the server. Once the purchase is processed, the quantities of the respective products will decrease. Sessions will also ensure that the user is logged in by checking their status once they click the checkout/purchase button on the shopping cart page. This will also be helpful because server can retrieve the user’s quantities and display the total number of products in the cart by the shopping cart on the navigation bar.
In terms of managing my shopping cart data, I will sessions and more specifically, arrays and objects to keep track of the user’s purchases. For example, on the server side I can request the session which has the user’s product purchases in the cart:
request.session[‘products’] = [{“name”: “Chocolate Chip Cookie”, “price”: 1.25, “user_quantity”: 8}];
With this, I can easily call the user’s number of quantities to find the total quantity purchased for each product which will help with updating my products.json file. I can call “user_quantity” and subtract that amount to the quantities_available in my json file. I can also add the total quantities by calling “user_quantity” and display the total number of products in the shopping cart on the navigation bar.
Some security concerns I need to address are to ensure users are unable to access other user’s data which can be avoided with the use of cookies. This is why the website will require users to login or register before completing their purchase despite being able to edit the shopping cart. Cookies can help with this as the user’s login status does not have to be permanent but can remain within the timeframe of the user’s session. Since cookies are not entirely secure and can be manipulated as it is on the client side, using cookies to check the user’s status should be alright. Another way I can prevent this is setting a timer. Once a certain amount of time has passed and there is no activity, then the website will automatically end the user’s session and log them out.
As discussed in the video, I plan on using cookies to determine if a user logged in successfully. If they did, I would be able to pull data such as the user’s username and display their name with a “Welcome [username] back!” in the navigation bar. I can also personalize the invoice where it will also incorporate the user’s information such as name and email address. These will be used to send the invoice to the user.
I am working on Assignment #3 by myself.
In terms of approach, Assignment 3 is just as challenge maybe even more than Assignment 2. I am on the lookout to determine if I have to start from scratch but for now I think what makes Assignment 3 a bit different is how I have to consider the user’s experience as I write the code. I need to make sure the user has access to all my web pages while keeping their data secure. There are alot more validations to consider and UI changes to be made. I also have to keep track of where the user is and how they will be moving around each web page. This is why having an outline really helps to understand how the user will navigate around my website.