Best Practice for login systen with asp.net

G

Guest

Hello

I'm just wondering wich might be the best practice for realizing a login
system.

At the moment im having a object of self written type 'user' wich carrys
user data like name, email and a bool for 'loggedin'. I pass this object via
session.

This brings me to the point where if have at the very top of my aspx-site a
if-statement, wich returns a "Sorry, you are not logged in!" in case of
failed login and a very large else, wich contains the whole site, in case of
success.

Beside the way I did the securtiy aspect, I really dont like to have the
whole content in a: else { .. my whole site ... }

Is there a different way wich i just dont see?

Hope you get my point.

Thx so far!

yours erich
 
L

Lucas Tam

Beside the way I did the securtiy aspect, I really dont like to have the
whole content in a: else { .. my whole site ... }

Is there a different way wich i just dont see?

Forms Authentication... Login is already pretty much built for you in
ASP.NET : )
 
G

Guest

Thank you!


Its not that I need to get a ready build application as soon as possible -
I`m just trying a bit with c# and asp.net.

So, Form Auth is something I`ll google for soon of course!
Beside that - if you werent using form auth, and would do it the old
fasioned way, would it be similar to my way?
 
L

Lucas Tam

So, Form Auth is something I`ll google for soon of course!
Beside that - if you werent using form auth, and would do it the old
fasioned way, would it be similar to my way?

There is no reason to do it any other way but forms authentication. Forms
Authentication handles session management and page security... so you don't
have to worry about it yourself. Basically is is THE way to do it in
ASP.NET.

Forms Authentication can be modified to support a variety of login types
and is quite extensible.
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top