Thoughts from Dan Miser RSS 2.0
# Tuesday, 25 March 2008

Problem: I have written my own membership provider to store and validate user information. Further, I have a web page that allows a user to come and sign up with a username, password, and a whole host of other client-related data. When the user submits that data, I would like to have them logged in.

Solution: Since I'm using Forms authentication for the ASP.NET website, it appears that the following code-snippet does what I want:

if (Membership.ValidateUser(u.UserName, u.Password))
    FormsAuthentication.SetAuthCookie(u.UserName, false); 
Tuesday, 25 March 2008 20:24:17 (GMT Standard Time, UTC+00:00)  #    Comments [0] -
.NET | ASP.NET
Navigation
Archive
<2016 December>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2016
Dan Miser
Sign In
Statistics
Total Posts: 388
This Year: 0
This Month: 0
This Week: 0
Comments: 630
Themes
Pick a theme:
All Content © 2016, Dan Miser
DasBlog theme 'Business' created by Christoph De Baene (delarou)