Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Correct way to check if authenticated on each page

Correct way to check if authenticated on each page

Scheduled Pinned Locked Moved ASP.NET
questioncsharpapachedatabasesecurity
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DeepToot
    wrote on last edited by
    #1

    I was given the task to take several websites and add login authentication to them. Currently, they are using Apache to login then it redirects to the site if their login was valid. What I was going to do, or did, was create a login page and use their custom authenticator class (which they wanted me to use) to validate then if successful redirect to the home page...simple enough. What I have a question on is if I am using this very basic (and probably old way) of doing this, can I add a session object "Authenticate" and set it to true if success, false if not. Then on the other pages during Page_Load check this session if authenticated and if not redirect to login page? Is this valid? Seems outdated and I know I can use the new Login Controls for .Net 3.5 but wasn't sure if I could or not. They are not using Windows Authentication or anything, it's what is typed in txtbox and validated in sql. The authentication class does this. Would appreciate any suggestions on how I could validate on each page if they were logged in or not. Thanks

    M 1 Reply Last reply
    0
    • D DeepToot

      I was given the task to take several websites and add login authentication to them. Currently, they are using Apache to login then it redirects to the site if their login was valid. What I was going to do, or did, was create a login page and use their custom authenticator class (which they wanted me to use) to validate then if successful redirect to the home page...simple enough. What I have a question on is if I am using this very basic (and probably old way) of doing this, can I add a session object "Authenticate" and set it to true if success, false if not. Then on the other pages during Page_Load check this session if authenticated and if not redirect to login page? Is this valid? Seems outdated and I know I can use the new Login Controls for .Net 3.5 but wasn't sure if I could or not. They are not using Windows Authentication or anything, it's what is typed in txtbox and validated in sql. The authentication class does this. Would appreciate any suggestions on how I could validate on each page if they were logged in or not. Thanks

      M Offline
      M Offline
      m khansari
      wrote on last edited by
      #2

      Hi It is valid to use session for that.

      Mohammad Khansari

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups