Hi there
there is a authentication config tag in the web.config file. by default it's set to :
HTML Code:
<authentication mode="Windows" />
so by default you are logged in by your system user. other valid values to 'mode' attribute are :Forms, Passport, None
Forms Authentication is the most appropriate method.
HTML Code:
<authentication mode="Forms" loginUrl="~/login.aspx" defaultUrl="~/default.aspx" />
LOGIN:
FormsAuthetication.SetAuthCookie(username, true/false);
first parameter is username and second one for persistent login.
LOGOUT:
FormsAuthetication.SignOut();
more information is available if you need it.