parseInt may throw NumberFormatException if a value that is not a number is returned from the cookie. As the cookie is sent from the client and might have been messed with, this should be catched or the server will crash here.