9

Is it possible to implement "Remember Me" using jquery? If so, any suggestion how it can be done?

EDIT:

I am trying to remember username and password using jquery cookies.store cookies about username and password and read it the next time and redirect to a specific page.

ACP
  • 34,682
  • 100
  • 231
  • 371
  • More information please. – amphetamachine Sep 30 '10 at 04:58
  • why would you store `username and password` as cookies? can't it be any other variables? – Reigel Gallarde Sep 30 '10 at 05:02
  • @Reigel thats what i am asking suggestion how it can be done? Please suggest possible ways of doing it? – ACP Sep 30 '10 at 05:03
  • it depends on what are you trying to achieve. I see you want to redirect to a page, but is it necessary for you to use username and password? `username` might be okay, but I doubt with `password`. why not something like `username` and `logged` ? `logged` would be a boolean with value depending if the user is logged or not. – Reigel Gallarde Sep 30 '10 at 05:07
  • @Reigel logged holds a value `True` until the user logs out. Is that what you are trying to say? – ACP Sep 30 '10 at 05:08
  • But what if the user faked the cookie to have value of True for logged. He can login without password. – Googlebot Sep 21 '11 at 15:40

1 Answers1

3

Look at this:

jQuery Cookie Plugin

How to implement:

Naveed
  • 41,517
  • 32
  • 98
  • 131
  • @Naveed this isn't an answer what i was looking for. I know this plugin but i want suggestions to implement "Remember Me" using this jquery cookie plugin. – ACP Sep 30 '10 at 05:06
  • @Pandiya Chendur: I have added a tutorial to implement this. – Naveed Sep 30 '10 at 05:08
  • @Reigel i ve removed -1. But this answer uses password as cookie value. Is that secure? – ACP Sep 30 '10 at 05:10
  • 2
    I'm not really sure about security. But why would I put that on the risk. Well, that tutorial is the way to go. Use other variables as you like. You can use password if you really want to. I just don't suggest it. `logged holds a value True until the user logs out.` is what i'm suggesting. – Reigel Gallarde Sep 30 '10 at 05:13
  • May be this thread will help to understand cookie security: http://stackoverflow.com/questions/2100356/is-it-secure-to-store-passwords-in-cookies – Naveed Sep 30 '10 at 05:15