A
Andrey Fedorov
Is the scope of a closure accessible after it's been created? Is it
safe against XSS to use closures to store "private" auth tokens? In
particular, in...
....can untrusted code access 'secret', or only the code inside foo?
- Andrey
safe against XSS to use closures to store "private" auth tokens? In
particular, in...
function closure(token) {
return function () {
// code which uses token to authenticate
}
}
foo = closure(secret);
delete secret;
// untrusted code
....can untrusted code access 'secret', or only the code inside foo?
- Andrey