I am trying to figure out the pros and cons of using sessionid based authentication vs cookie based authentication
As far as I can see in cookie based authentication
In case of session based authentication
Questions
Is there any reason to prefer one over the other? Is the cookie based less secure (even if you encrypt and sign them)? Is the performance of session based worse since it hits the database during each call? I have seen several sites leaning one way or the other but could not get a clear picture of what approach to use. Any discussions/suggestions would be greatly appreciated.
I'm having a hard time digesting this question. To my knowledge, forms-based authentication comes in two flavors: cookies and cookieless. Cookie-based authentication is preferred.
In the cookie-based version, the user gets a coookie whose value is an encrypted Forms Authentication Ticket. The cookie is encrypted at the server. Unless the encryption key is shared from machine.config or over-written in Web.config, the cookie can only be decrypted by the server that issued it. I believe the encryption is AES, which is very secure.
In the cookieless approach, the payload of the cookie is put in the url using an HTTPModule. This approach is only used when the device does not support cookies (rare). The cookieless approach is not preferred - it makes AJAX more difficult.
See:
http://msdn.microsoft.com/en-us/library/1d3t3c61.aspx
and
http://support.microsoft.com/kb/910443
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With