fixing cookies and ajax pagination