added function to check login cookies and dynamic navigation bar