将随机数添加到登录表单的URL的目的是什么?

one*_*ros 1 javascript web

当登录表单发布到服务器处理程序时,发送math.random nocache参数的目的究竟是什么?

var email = encodeURI(document.getElementById('emailLogin').value);
var psw = encodeURI(document.getElementById('pswLogin').value);
// Set te random number to add to URL request
nocache = Math.random();
// Pass the login variables like URL variable
http.open('get', 'login.php?email='+email+'&psw='+psw+'&nocache = '+nocache);

Nat*_*han 5

添加到请求的随机数是强制浏览器加载以下页面结果,而不是可能显示可能已被先前请求缓存的结果.

它的价值 - 这似乎是一个非常不安全的身份验证器 - 除非http.open()发生在HTTPS(SSL/TLS)连接上.