added the beginnings of cookie support and made record cache length sensitive