Form Authentication

F

Frank

Hi,
I'm creating a class, that will go to a database and authenticate if the
user
exist and the password is correct.
What I don't understand, is how I tell my application that the user is
authenticated (during a time period), so It doesn't keep asking for the
login.
Francisco
 
F

Frank

Do I need a session variable to say the user is log on or SetAuthCookie and
GetAuthCookie is enough to do so.
Thanks
 
D

Dominick Baier [DevelopMentor]

Hi,

you usually use RedirectFromLoginPage or SetAuthCookie to set the cookie.
The FormsAuth infrastructure will transparently decrypt the cookie and populate
Context.User on subsequent requests for you. No SessionState needed at all.

look at

Context.User.Identity.Name and .IsAuthenticated

after authentication
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top