cookie validation added + logout function should now work