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. UserName and Password Validation

UserName and Password Validation

Scheduled Pinned Locked Moved ASP.NET
questionhelp
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.
  • A Offline
    A Offline
    Asad Hussain
    wrote on last edited by
    #1

    Hi, I am trying to make an ASP page that requires username and password validation. After the user's username and password is validated, Session("loginValidated") is set to true and the user is redirected to the main webpage (let's call is main.aspx). In main.aspx, the Session("loginValidated") is checked on load to see if the user got there by just entering the username and password directly. The problem is that when the user leaves the main.aspx page (in the same session) and then comes back to it, he shouldnt be able to see the information. How do I stop them from coming back to the page directly? Thanks in advance.

    A 1 Reply Last reply
    0
    • A Asad Hussain

      Hi, I am trying to make an ASP page that requires username and password validation. After the user's username and password is validated, Session("loginValidated") is set to true and the user is redirected to the main webpage (let's call is main.aspx). In main.aspx, the Session("loginValidated") is checked on load to see if the user got there by just entering the username and password directly. The problem is that when the user leaves the main.aspx page (in the same session) and then comes back to it, he shouldnt be able to see the information. How do I stop them from coming back to the page directly? Thanks in advance.

      A Offline
      A Offline
      Ather Ali Shaikh
      wrote on last edited by
      #2

      You have to define small function or just check your Session("loinValidated") = true or not, if it is false redirect it to login page. use this check to all pages except login page. if Session("loinValidated") = false then response.redirect("Login.aspx") End if if you want prevent caching the pages use this line on top of the every page and then check validation Response.Cache.SetCacheability(HttpCacheability.NoCache) Regards Ather Ali Shaikh Sr. Software Engineer eIntelligence Pvt. Ltd. Karachi, Pakistan.

      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