Web Site / Variables

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

    #1

    Web Site / Variables

    I'm making a Web Site with Visual Basic .Net and i need the user to log on in
    order to have access to some pages on the web site. How can i maintain the
    username and password variables from the login page allways availlable to the
    other pages in order to determine the access level, that the user has, for
    each page?
    (Maybe there's another technique that i don't know without using variables)

    My thanks in advanced
  • Bob Powell [MVP]

    #2
    Re: Web Site / Variables

    The Session object is usually used for this purpose.

    You can do the login and set Session("logged in")=true

    The key "loggedin" will persist across pages and will be available to the
    rest of your application.

    When the user logs out you can do Session.Abandon to clear any information
    that might be hanging about associated with that client session.

    --
    Bob Powell [MVP]
    Visual C#, System.Drawing

    Ramuseco Limited .NET consulting


    Find great Windows Forms articles in Windows Forms Tips and Tricks


    Answer those GDI+ questions with the GDI+ FAQ


    All new articles provide code in C# and VB.NET.
    Subscribe to the RSS feeds provided and never miss a new article.





    "Ricardo Furtado" <RicardoFurtado @discussions.mi crosoft.com> wrote in
    message news:E0E570B4-2E22-4C0C-8631-13236034827D@mi crosoft.com...[color=blue]
    > I'm making a Web Site with Visual Basic .Net and i need the user to log on
    > in
    > order to have access to some pages on the web site. How can i maintain the
    > username and password variables from the login page allways availlable to
    > the
    > other pages in order to determine the access level, that the user has, for
    > each page?
    > (Maybe there's another technique that i don't know without using
    > variables)
    >
    > My thanks in advanced[/color]


    Comment

    Working...