cookie checking and get logged user