Documentation and some changes concerning cookie hanlding