Setting up cookie authentication. Logging cookie keys in the database.