User/Form information in meta tags?
I have noticed on some MVC apps that certain infomation is stored in the meta tags like so:
<meta name="app-form-key" content="DMRNNNcRNkzzzghzNiM1N2DQwM5YNMyWzmkGUhULIj1ggEMwTyDYZAxkTTMMcuO1jRGD4MTO">
<meta name="app-userid" content="20031">
<meta name="app-username" content="driz">
What would the reasons be for doing this? Hoping to learn more about MVC and the practices of current sites that 开发者_如何学运维use this pattern.
For what its worth - this shouldn't be specific in any way to an MVC pattern. Nothing in MVC dictates data to be sent this way and considering it's not used in form posts, I can only imagine its some implementations way of storing page info that is not dependent on a form, since the meta tags can be enumerated via javascript easily. I know its not a direct answer to your question, but - from a patterns standpoint - there is no specific reason to do this. It's not by any means part of say ASP.Net's MVC either.
The fact a form key is there, I'd be curious if its used for any client side validation/encryption or hash checking.
精彩评论