My application was written in ASP.Net 3.5 due to server limitations at the time and so some of the newer encryption methods were not available to me. I found this clever solution to encrypt my cookie data string and used it.
This code works fine if you are within the same domain, but my apps were on two different sub domains. The servers were different OSs and the applications themselves were different versions of .Net - one was ASP.Net 3.5 and the other was ASP.Net 4.0 which apparently encrypt and decrypt data completely differently and so even though my cookie was encrypted in the 3.5 app, the 4.0 app couldn't decrypt it.
You have to use a common machine key between the applications. That's understandable, but when apps are different .Net versions you also have to tell the machine key which Framework to use so that if you encrypt cookies, your apps are speaking at the same level. Use the compatibilityMode attribute on the machine key node in your web config to set this value on both your web applications. Below is the example. I had to use Framework20SP2 since one of my apps was 3.5. See Microsoft's article for additional frameworks.
<machineKey validationKey="NumbersHere" decryptionKey="MoreNumbersHere" validation="EncyrptionMethodHere (i.e. AES, SHA1, HMACSHA256, etc.)" decryption="DecryptionMethodHere (i.e. AES, DES, Auto, etc.)" compatibilityMode="Framework20SP2" />
Voila! Success encrypting a cookie between sites on sub domains with differing versions of ASP.Net.
Good work…unique site and interesting too… keep it up…looking forward for more updates.Good luck to all of you and thanks so much for your hard-work.ReplyDelete
Transcription Services in Bangalore, Closed Captioning Services in Bangalore,Localization And Translation Services
I am very happy when read this blog post because blog post written in good manner and write onReplyDelete
good topic. Thanks for sharing valuable information.
Web Design Company Bangalore,
Digital Marketing Company
We can learn a lot about Why Deep Learning Works by studying the properties of the layer weight matrices of pre-trained neural networks. And, hopefully, by doing this, we can get some insight into what a well trained DNN looks like–even without peaking at the training data.ReplyDelete
MACHINE LEARNING training in chennai
Really nice content ... Admin... Have great information I contribute with your experienced... I hope you post again soon. I am very happy to leave a comment for this blog, which really put honest information...ReplyDelete
Lucrative Marketing Flyers Design, Business Flyers Design
Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.ReplyDelete
Best PHP Training Institute in Chennai|PHP Course in chennai
Best .Net Training Institute in Chennai
Dotnet Training in Chennai
Dotnet Training in Chennai
Thanks for sharing this blog. I learnt something useful about coding, thanks a lot.ReplyDelete
Best Website Development Company in Coimbatore