-4

I am using cookie in a page to record the user's input in a form. After the user login, i want to automatically fill in the form by using their old cookie.

Basically, i want to record some cookies, and let user login, and output the cookies.

In the first page, I set the cookies, however, after I redirect with

window.location.href

My cookies just recorded are set to null/deleted automatically.

Any ideas?

Thanks

jackhao
  • 3,457
  • 3
  • 22
  • 43

1 Answers1

1

If everyone else meets same problems, this is simply because the cookie's path problem.

When you set the cookie, do this :

$.cookie('the_cookie', 'the_value', { expires: 7, path: '/' });

So the cookie can be cross-pages.

:]

jackhao
  • 3,457
  • 3
  • 22
  • 43