reading index from cookie