<!DOCTYPE html>
<html> <head> <meta charset="UTF-8"> <title></title> <script src="md5.js" type="text/javascript" charset="utf-8"></script> <script src="public.js" type="text/javascript" charset="utf-8"></script> </head> <body> <label for="">用户名:</label><input type="text" /><br /> <label for="">密 码:</label><input type="password" /><br /> <input type="checkbox"/>记住用户名和密码<br /> <input type="button" value="登录" /> <script type="text/javascript"> var aInput=document.getElementsByTagName('input'); if(getCookie('username') && getCookie('password')){ aInput[0].value=getCookie('username'); aInput[1].value=getCookie('password'); aInput[2].checked=true; } aInput[3].οnclick=function(){ //alert(getCookie('sex'));//undefined:如果cookie值不存在输出undefined if(aInput[2].checked){ addCookie('username',aInput[0].value,7); addCookie('password',hex_md5(aInput[1].value),7); }else{ delCookie('username'); delcookie('password'); } } </script> </body></html>
cookie应用(一周内免登陆)
发布日期:2021-08-13 04:05:36
浏览次数:49
分类:技术文章
本文共 993 字,大约阅读时间需要 3 分钟。
转载于:https://www.cnblogs.com/xuxiaoxia/p/6710740.html
转载地址:https://blog.csdn.net/weixin_30675247/article/details/98989561 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
不错!
[***.144.177.141]2024年04月12日 12时19分50秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
你不得不了解的深度学习知识(一)
2019-04-26
你不得不了解的深度学习知识(二)
2019-04-26
AI算法之Encoder-Decoder 和 Seq2Seq
2019-04-26
AI算法之Attention机制
2019-04-26
人体口罩佩戴检测实战
2019-04-26
[实战]200类鸟类细粒度图像分类
2019-04-26
【实战】英文垃圾短信分类
2019-04-26
FFmpeg初遇见_基本命令
2019-04-26
Urbansound8k声音分类深度学习实战
2019-04-26
pytorch版本下的yolov3训练实现火焰检测
2019-04-26
yolov4训练自己的数据集实现安全帽佩戴检测
2019-04-26
EfficientDet训练自己的数据集实现抽烟检测
2019-04-26
【工具篇】10分钟快速上手git与github
2019-04-26
【开发篇】10分钟快速上手spring boot
2019-04-26
【开发篇】10分钟快速spring boot+react前后端分离
2019-04-26
【Leetcode刷题篇】leetcode203 移除链表元素
2019-04-26
【Leetcode刷题篇】leetcode938 二叉搜索树的范围和
2019-04-26
【Java网络编程与IO流】Java中BIO、NIO、AIO的区别是什么?
2019-04-26
【Leetcode刷题篇】leetcode136 只出现一次的数字
2019-04-26
spring boot整合thymeleaf,支持JSP和HTML页面开发
2019-04-26