locked
The safest way to pass user/pass through asp.net pages?! RRS feed

  • Question

  • User-1887133141 posted

    Hi pals,

    I have created a page with 2 textBoxes, one named userText for username and the other, passText for password. Let's imagine the correct username and password, both, are "admin". I am going to pass these two strings though some of my administrative pages. Please help me to do the safest method for applying this functionality.

    Wednesday, May 14, 2014 3:18 PM

Answers

  • User724169276 posted

    benglish

    Could you please give/show me a piece of code to know how to implement it?

    SET:

    Session["username"]=txtusername.Text;
    Session["password"]=txtpassword.Text;

    GET:

    string username=Convert.ToString(Session["username"]);
    string password=Convert.ToString(Session["password"]);

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 15, 2014 4:05 AM

All replies

  • User-1360095595 posted

    Session.

    Wednesday, May 14, 2014 3:35 PM
  • User-760709272 posted

    Safest will be to store the username and password in the session.

    Wednesday, May 14, 2014 3:35 PM
  • User-1887133141 posted

    Could you please give/show me a piece of code to know how to implement it?

    Thursday, May 15, 2014 12:06 AM
  • User724169276 posted

    benglish

    Could you please give/show me a piece of code to know how to implement it?

    SET:

    Session["username"]=txtusername.Text;
    Session["password"]=txtpassword.Text;

    GET:

    string username=Convert.ToString(Session["username"]);
    string password=Convert.ToString(Session["password"]);

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 15, 2014 4:05 AM