Security based on session, what's wrong?

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Security based on session, what's wrong?

    Hello,

    I'm working on a portal derived from IBuySpy, and I have changed

    I check username and pwd against a database, then I make a
    Session["User"]= UserID (the ID I get from the database, if it
    exists).
    Now I create all the pages based on that ID stored in a session
    variable.
    If that user is authorized to see a certain tab, module or content,
    the page is created that way. All the auth info (user/contents) are
    stored in another database table.

    Everything works fine without use fo forms authentication.
    Is there something wrong with it? should I use forms authentication?
    why?

    Thanks,
    Mattia
    Matt Guest

  2. Similar Questions and Discussions

    1. Forms based security
      Hi there, In forms based security do I have to arrange pages into subdirectories in order to secure them? I want the public to access my home page...
    2. Do I need Role Based Security
      Corinna, In your example i'd say its not necessary to use role-based security. Since there's only 1 level of membership as you say then all I...
    3. Reg Role BAsed security..
      Hi All.. Can any body detail out the basic diff/advatages/disadvantage over acheiving the role based security and the same thing in case of...
    4. Security Based on NT Groups
      You can disable anonymous access to the site so the users have to log in (can be automatic in an intranet environment so users don't have to enter...
  3. #2

    Default Re: Security based on session, what's wrong?

    You can always go and build your own authentication and authorization mechanism.
    The intent of Forms is that much of the routine checks and identity management
    is done for you. Of course there are pieces you have to fill in, such as
    the login page and the database of usernames/passwords, but the check on
    every page is done for you to see if the user is logged in and if they're
    allowed to access the pages. The cool thing is that this is declarative with
    the <authorization> elements in web.config, and there's typically little
    or no access checks you have to write in your own code.

    -Brock
    DevelopMentor
    [url]http://staff.develop.com/ballen[/url]


    > Hello,
    >
    > I'm working on a portal derived from IBuySpy, and I have changed
    >
    > I check username and pwd against a database, then I make a
    > Session["User"]= UserID (the ID I get from the database, if it
    > exists).
    > Now I create all the pages based on that ID stored in a session
    > variable.
    > If that user is authorized to see a certain tab, module or content,
    > the page is created that way. All the auth info (user/contents) are
    > stored in another database table.
    > Everything works fine without use fo forms authentication.
    > Is there something wrong with it? should I use forms authentication?
    > why?
    > Thanks,
    > Mattia


    Brock Allen Guest

  4. #3

    Default Re: Security based on session, what's wrong?

    Ok, then if I just create my authorization mechanism, and just rely
    from page to page to the Session["IDUser"] to create my page, is not
    less safe than using the Forms authentication mechanism?

    Sometimes I have the feeling that Session (I use InProc) expires
    earlier than the specified n minutes of the web.config (my app found
    Session["IDUser"] empty and resets to the login page)
    I use a sWindows2003 server with IIS6, with multiple asp.net portals
    with the same codebase running on it.
    I know that with forms auth you have to specify different form name
    instead of the default ASPAUTH, is the same for session cookie?

    Thanks,
    Mattia


    >You can always go and build your own authentication and authorization mechanism.
    >The intent of Forms is that much of the routine checks and identity management
    >is done for you. Of course there are pieces you have to fill in, such as
    >the login page and the database of usernames/passwords, but the check on
    >every page is done for you to see if the user is logged in and if they're
    >allowed to access the pages. The cool thing is that this is declarative with
    >the <authorization> elements in web.config, and there's typically little
    >or no access checks you have to write in your own code.
    >
    >-Brock
    >DevelopMentor
    >[url]http://staff.develop.com/ballen[/url]
    >
    >
    Matt Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139