added logout functionality
persistent login sessions thanks to cookie