Looking to create a script for an ecommerce site

Hi there, its been a while since I used Java but I’m working inside this web hosting cms and Java is the only thing they allow. Anyways, I’m looking to create a script that works in the following way:

If a person adds a product to his/her cart and if he/she is logged in, their is a discount price. If they aren’t logged in then they don’t receive the discount price.

Its pretty simple but I’m fairly new to Java still but could anyone give me any guidance at all? I would need to detect if the person is logged in or not but for the different pricing would it be something along the lines of me creating an array to hold my products with the different pricing? Are there any security problems I should worry about as well when making a script like this? Thanks for any help.

Create a session just set a session if the user logged in. Through this can do it