1.11M Members

How to find if the user has logged in for the first time - C#

 
0
 

The scenario is, If the user has logged in for the first using his one time password it should get redirected to ResetPassword.aspx

If the user is not new, then should get redirected to Main.aspx page.

Should I use IsPostBack or Membership.ValidateUser?

How do we usually code in c# to check if its a new user (using first time login)

I am a newbie to programming not getting enough info on net. Please help

 
-1
 

HI, You can use session.
or
You can add one more field in DB check to whether user is active user or not.

 
2
 

Generally you would include a field in the DB containing the last log on date, if this value is null, then it's a first time log on.

If you want to do things like forced password reset; the simplest way is to include a bit column that just states "ResetRequired" or something and set that to 1 in order to force the change.

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: