简体   繁体   中英

create a log in with javascript and html.

I want to create a log in with javascript and html. I use prompt when someone create a new user and password. I would like to know how to save the created password and user locally.

My code works but when I close the web browser, you have to create another username and password each time you want to come back to the website. I need to have something that will save the created password and username that the user create with prompt. This user and password will be use for the log in even if we close the web page. Thanks a lot.

The best way to do that locally (I hope this is for entertainment purposes only because what you are doing is clearly not secure) would be to store it as a cookie .

I recommend checking out this nice stackoverflow post talking about setting and unsetting cookies with jquery . How do I set/unset cookie with jQuery?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM