开发者

ViewState Encryption - Multiple sites on one server

I have a web farm with multiple websites on each server. I am manually generating my validation and decryption keys. Can I use the same keys for different websites开发者_开发知识库?


Yes you can; system.web has the machinekey element. MSDN has details on how to set it, you will want to set the validation and decryption keys to be the same across all servers (but not the same key for both validation and decryption if you see what I mean).

You'll need to generate the keys, again MSDN has sample code for this.

If you want every website on the server to share a key (bad idea though), you can set the machinekey element in machine.config and copy that onto each server in your farm.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜