Added more secure cookie creation
Added cookie validation
Added cookie parsing
Refactored views to make use of the new cookies
Slight refactor to reduce repetition in test cases