Click here to Skip to main content
15,915,636 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want the code for the password, the password should expire after 90 days
Posted

We can't answer that - we don't know anything about your login system.

However, if you are using the Membership system, then:

1) Add an event handler for the HttpApplication.PostAuthenticateRequest event in global.asax
2) Find the user in the membership database and get LastPasswordChangedDate
3) Using a TimeSpan, compare this with the current date and decide if the password was last changed more than the requisite number of days ago
4) If expired, redirect to the ChangePassword screen
 
Share this answer
 
Hi ,
IF u are using Cookies you should have this line in ur code

C#
Cookies.Expires = DateTime.Now.AddDays(90);


Best Regards
M.Mitwalli
 
Share this answer
 
you can take a table in the db, when ur loggin to the application insert a record into the table. And in your code check if it is 90 days then redirect to the version expired page
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900