Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

ASP.NET & Sessions

Back to Forum: Tech Off
  • User profile image
    jsampsonPC

    Are sessions created by default in ASP.NET websites? I'm trying to figure out how I should do a user-login system, and I thought about using sessions. It seems as though sessions are put into effect by default when an ASP.NET web application begins.

  • User profile image
    zhuo

    jsampsonPC wrote:
    Are sessions created by default in ASP.NET websites? I'm trying to figure out how I should do a user-login system, and I thought about using sessions. It seems as though sessions are put into effect by default when an ASP.NET web application begins.


    Yes a session is created for each user connected to website whether you like it or not.

    There are many ways by you could implement a login system. The simplest is to store some info in the session and so when the user session expires the user is logged out again.

    Channel  obviously uses some sort of cookie to autologin user, this cookie is probably a hashed value of some sort and this is used to authenticate user when they first come to the channel9 site if they have not been authenticated already, this approach allows you to auto-login a user.

  • User profile image
    aghiondea

    If you want a login system you could try using Forms Authentication and rely of IIS to do all the dirty work regarding tracking user. All you need to do is provide the logic to authenticate the user.

    If you use ASP.NET 2.0 there is a nice Login Control that you can use. If you also use SQL Server, you can let *them* take care of your login problems. Just run aspnet_regsql.exe and tell where to store the login data and then add a connection string to your web.config pointing to that database. You can find more information about this here:
    http://msdn.microsoft.com/library/en-us/dnvs05/html/SecFeatNT2.asp?frame=true
    and here:
    http://msdn.microsoft.com/msdnmag/issues/04/06/ASPNET20Security/

    Alexandru Ghiondea
    MCP

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.