javascript - Ext JS 4 - Unchangeable cookies -


i need prevent hijack attacks through html cookies. i'm using ext.state.cookieprovider manage sessions; want unchangeable end users (actually hijackers). it'll changeable through application functions. there solutions situation?

i believe solved ecmascript 6's const functionality, supported in newer versions of firefox , chrome (if enable experimental javascript):

const cookie = "username=david;"; cookie = "username=lincoln;"; console.log(cookie);  // returns "username=david;" 

but other waiting that, if cookie object, can use object.freeze, pretty nifty:

var cookie = {cookie: 'username=david;'}; object.freeze(cookie); cookie.cookie = 'username=lincoln;';  // returns "username=lincoln;" console.log(cookie.cookie);  // returns "username=david;" 

unfortunately, cookie object can overwritten, @ least protects against simple attacks.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -