Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to write the code for encrypting jQuery password to cookie

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains the "jQuery encryption password to cookie code how to write", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "jQuery encryption password to cookie code how to write" it!

The specific code is as follows:

Insert title here account: password: read function setCookie () {/ / set cookie var loginCode = $("# username") .val (); / / get user name information var pwd = $("# password") .val (); / / get login password information $.cookie ("username", loginCode) / / call the method in jquery.cookie.js to set the user name $.cookie in cookie ("pwd", $.base64.encode (pwd)); / / call the method in jquery.cookie.js to set the login password in cookie and encrypt it using base64 (jquery.base64.js)} function getCookie () {/ / get cookie var loginCode = $.cookie ("username") / / get the user name in cookie var pwd = $.cookie ("pwd"); / / get the login password in cookie if (loginCode) {/ / if the user name exists, fill the user name into the user name text box $("# username") .val (loginCode) } if (pwd) {/ / if the password exists, fill the password into the password text box $("# password") .val ($.base64.decode (pwd)) }} Thank you for your reading, the above is the content of "how to write the code from jQuery encrypted password to cookie". After the study of this article, I believe you have a deeper understanding of how to write the code from jQuery encrypted password to cookie, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report