Setting cookies and inserting same document twice