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. session related...

session related...

Scheduled Pinned Locked Moved ASP.NET
databasehelp
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.
  • R Offline
    R Offline
    r_e_h_a_n
    wrote on last edited by
    #1

    I created a login page with session, login and making session working good but there is a problem that when a user login successfully his/her Firstname and last name should be apear in the Welcome Page e.g( a username "reehan" logged in with his password, he logged in successfully and redirected to another page there message should be show "Welcome! Reehan Munir" Rehan Munir could be retrieve from database of that particular user "reehan") have any idea about that. m.reehanmunir

    D 1 Reply Last reply
    0
    • R r_e_h_a_n

      I created a login page with session, login and making session working good but there is a problem that when a user login successfully his/her Firstname and last name should be apear in the Welcome Page e.g( a username "reehan" logged in with his password, he logged in successfully and redirected to another page there message should be show "Welcome! Reehan Munir" Rehan Munir could be retrieve from database of that particular user "reehan") have any idea about that. m.reehanmunir

      D Offline
      D Offline
      Daniel Santillanes
      wrote on last edited by
      #2

      There are several ways to do that. For example when the user logs in, the query you use to check for the login / password could also retrieve the first and last name, and you could pass them to the other page through querystring, or session variables. Another way is when the user logs in, pass the user id with either querystring or session variable and then query again to retrieve the information. What I usually do, is create a 'user' class that contains the details of the user, then when I check login / password I also retrieve all the details of the user, then I store all this information in a 'user' instance and keep this object in a session variable. So as long as this object exists in the session variable, you know the details of the logged in user, if not (session variable is null), then I redirect to the login page. daniero

      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