add $.cookie to implement Pre-render function