Session Variables in .NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Carl

    #1

    Session Variables in .NET

    Hi,

    I am starting to develop an ASP.Net application.

    I will have a logon page which will take a UserName and
    Password. A Stored Procedure will verify that the logon
    is correct.

    I was going to use a Session Variable to indicate whether
    the user is logged on or not. Based on this variable I
    would show certain links, allow access to certain pages.

    Is this a good idea or is there a better way?

    Thanks.
    Carl.
  • abacnet

    #2
    Re: Session Variables in .NET

    Go here http://www.asp.net/Tutorials/quickstart.aspx and check the
    Forms-Based Authentication section. Some of the job is already done for you,
    using cookies and encryption. There is also a smple for the login. Good
    luck.

    "Carl" <carl@nospam.co m> wrote in message
    news:03d201c35a d8$ab3922b0$a60 1280a@phx.gbl.. .[color=blue]
    > Hi,
    >
    > I am starting to develop an ASP.Net application.
    >
    > I will have a logon page which will take a UserName and
    > Password. A Stored Procedure will verify that the logon
    > is correct.
    >
    > I was going to use a Session Variable to indicate whether
    > the user is logged on or not. Based on this variable I
    > would show certain links, allow access to certain pages.
    >
    > Is this a good idea or is there a better way?
    >
    > Thanks.
    > Carl.[/color]


    Comment

    • Carl

      #3
      Re: Session Variables in .NET

      Thanks for that abacnet.

      Thing is that the app will be accessed over the Internet
      by strangers who can create an account and login.

      So I gues s all I can use is a Session to indicate if
      they have logged in or not.

      Carl.
      [color=blue]
      >-----Original Message-----
      >Go here http://www.asp.net/Tutorials/quickstart.aspx and[/color]
      check the[color=blue]
      >Forms-Based Authentication section. Some of the job is[/color]
      already done for you,[color=blue]
      >using cookies and encryption. There is also a smple for[/color]
      the login. Good[color=blue]
      >luck.
      >
      >"Carl" <carl@nospam.co m> wrote in message
      >news:03d201c35 ad8$ab3922b0$a6 01280a@phx.gbl. ..[color=green]
      >> Hi,
      >>
      >> I am starting to develop an ASP.Net application.
      >>
      >> I will have a logon page which will take a UserName and
      >> Password. A Stored Procedure will verify that the logon
      >> is correct.
      >>
      >> I was going to use a Session Variable to indicate[/color][/color]
      whether[color=blue][color=green]
      >> the user is logged on or not. Based on this variable I
      >> would show certain links, allow access to certain[/color][/color]
      pages.[color=blue][color=green]
      >>
      >> Is this a good idea or is there a better way?
      >>
      >> Thanks.
      >> Carl.[/color]
      >
      >
      >.
      >[/color]

      Comment

      • abacnet

        #4
        Re: Session Variables in .NET

        I don't see the problem, that's what the cookie is all about. And anyhow I
        think the session uses cookies indirectly.

        "Carl" <carl@nospam.co m> wrote in message
        news:042d01c35a e1$cdbb2000$a50 1280a@phx.gbl.. .[color=blue]
        > Thanks for that abacnet.
        >
        > Thing is that the app will be accessed over the Internet
        > by strangers who can create an account and login.
        >
        > So I gues s all I can use is a Session to indicate if
        > they have logged in or not.
        >
        > Carl.
        >[color=green]
        > >-----Original Message-----
        > >Go here http://www.asp.net/Tutorials/quickstart.aspx and[/color]
        > check the[color=green]
        > >Forms-Based Authentication section. Some of the job is[/color]
        > already done for you,[color=green]
        > >using cookies and encryption. There is also a smple for[/color]
        > the login. Good[color=green]
        > >luck.
        > >
        > >"Carl" <carl@nospam.co m> wrote in message
        > >news:03d201c35 ad8$ab3922b0$a6 01280a@phx.gbl. ..[color=darkred]
        > >> Hi,
        > >>
        > >> I am starting to develop an ASP.Net application.
        > >>
        > >> I will have a logon page which will take a UserName and
        > >> Password. A Stored Procedure will verify that the logon
        > >> is correct.
        > >>
        > >> I was going to use a Session Variable to indicate[/color][/color]
        > whether[color=green][color=darkred]
        > >> the user is logged on or not. Based on this variable I
        > >> would show certain links, allow access to certain[/color][/color]
        > pages.[color=green][color=darkred]
        > >>
        > >> Is this a good idea or is there a better way?
        > >>
        > >> Thanks.
        > >> Carl.[/color]
        > >
        > >
        > >.
        > >[/color][/color]


        Comment

        • abacnet

          #5
          Re: Session Variables in .NET

          Check this site if you have some time
          http://msdn.microsoft.com/library/de...secnetch08.asp



          "Carl" <carl@nospam.co m> wrote in message
          news:042d01c35a e1$cdbb2000$a50 1280a@phx.gbl.. .[color=blue]
          > Thanks for that abacnet.
          >
          > Thing is that the app will be accessed over the Internet
          > by strangers who can create an account and login.
          >
          > So I gues s all I can use is a Session to indicate if
          > they have logged in or not.
          >
          > Carl.
          >[color=green]
          > >-----Original Message-----
          > >Go here http://www.asp.net/Tutorials/quickstart.aspx and[/color]
          > check the[color=green]
          > >Forms-Based Authentication section. Some of the job is[/color]
          > already done for you,[color=green]
          > >using cookies and encryption. There is also a smple for[/color]
          > the login. Good[color=green]
          > >luck.
          > >
          > >"Carl" <carl@nospam.co m> wrote in message
          > >news:03d201c35 ad8$ab3922b0$a6 01280a@phx.gbl. ..[color=darkred]
          > >> Hi,
          > >>
          > >> I am starting to develop an ASP.Net application.
          > >>
          > >> I will have a logon page which will take a UserName and
          > >> Password. A Stored Procedure will verify that the logon
          > >> is correct.
          > >>
          > >> I was going to use a Session Variable to indicate[/color][/color]
          > whether[color=green][color=darkred]
          > >> the user is logged on or not. Based on this variable I
          > >> would show certain links, allow access to certain[/color][/color]
          > pages.[color=green][color=darkred]
          > >>
          > >> Is this a good idea or is there a better way?
          > >>
          > >> Thanks.
          > >> Carl.[/color]
          > >
          > >
          > >.
          > >[/color][/color]


          Comment

          Working...