Commented all Java and JavaScript code and added minor code improvements. Set maximum age for cookies to 15 minutes.