What is the Advantage of forms authentication over using session variable?

Posted by Hanishani under ASP.NET on 9/8/2013 | Points: 10 | Views : 4604 | Status : [Member] | Replies : 2
Hai, I want to know the advantage of using forms authentication in asp.net application over using session variables?

Thanks in Advance.




Responses

Posted by: Bandi on: 9/8/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
refer this link
http://stackoverflow.com/questions/16545978/what-does-forms-authentication-protect-as-opposed-to-using-session-variable
http://msdn.microsoft.com/en-us/magazine/cc300437.aspx

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Hanishani, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Webmaster on: 9/8/2013 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
A lot of advantage, few of them are listed here.

1. In forms authentication, a cookie is created that is client side so no load on the server however in session, different session objects are created for different user so load on the server.

2. In Forms authentication, you will have a inbuilt object that provides you all the details of authentication that you can use wherever you want. In session you will have to check for Session manually for each page you want to authenticate that is repeating of code and a lot of work, also prone to error in case session expired.

3. Your code looks neater and there are different kinds of forms authentication its mode and the way it works so no need to worry even if end user has disabled the cookie.

To know how to use Forms Authentication, please read this article http://www.dotnetfunda.com/articles/article114.aspx. To know role based forms authentication, read this article http://www.dotnetfunda.com/articles/article141.aspx.

Hope this helps.

Best regards,
Webmaster
http://www.dotnetfunda.com

Hanishani, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response