Check cookies and if it is necessary then change their values