checks for cookies if none saved then redirects to main page