replaced readCookie with $.cookie