Portal Engine
Version 3.x > Portal Engine > Encrypted Cookie View modes: 
User avatar
Member
Member
TC - 11/26/2008 8:22:00 AM
   
Encrypted Cookie
Hi,

Is it possible to encrypt the cookie that is created by the authentication process?

Thanks
TC

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 11/26/2008 8:58:31 AM
   
RE:Encrypted Cookie
Hello,

Could you please specify your requirement? I am not quite sure, what do you mean by encrypting the cookie?

Best Regards,
Boris Pocatko

User avatar
Member
Member
TC - 11/26/2008 9:11:12 AM
   
RE:Encrypted Cookie
Hi Boris,

I have tried overriding OnAuthentication in the CustomSecurityHandler to add a cookie to the Cookies Collection which contains encrypted data (using standard FormsAuthentication). However, for some reason all my cookies are removed during the authentication process (I am using a cloned copy of the LogonMiniForm web part).
Using standard FormsAuthentication methods I can add data to a cookie which is encrypted and cannot be read without decryption.

Is it possible to add additional cookies to the cookies collection?

If this is not possible, I am wondering if it is possible to use the CookieHelper class to add values to the standard cookie but to encrypt the values?
Currently, if I use CookieHelper.SetValue, the Key/Value pairs are stored in the cookie in plain text.

Thank you for your assistance.
TC


User avatar
Member
Member
trinh.chuong-yestelco - 11/26/2008 9:23:21 AM
   
RE:Encrypted Cookie
Some additional information, all my cookies are replaced with a cookie named "CMSPreferredUICulture" during the authentication process.

Thanks

User avatar
Member
Member
trinh.chuong-yestelco - 11/26/2008 10:28:17 AM
   
RE:Encrypted Cookie
Hello,

Sorry my mistake, I was using Response.Cookies rather than Request.Cookies.
Everything is working fine.

My bad!

TC