implemented session information using cookies and database for extra protection