querystring probelm?

Last post 10-27-2008 9:51 AM by Deleo. 4 replies.

Sort Posts:

  • querystring probelm?

    10-27-2008, 3:27 AM

     hi..all

    how to protet querystring in our asp.net application.for example i hav a login form..i used querystring for passing information from one page to another.suppose we know the path we can easily access the account....i need to protect the querystring..any ideas.......plz help its very urgent...

    Filed under:
  • Re: querystring probelm?

    10-27-2008, 3:44 AM
    Answer
    • All-Star
      124,276 point All-Star
    • XIII
    • Member since 06-30-2002, 11:59 PM
    • Essen, Belgium
    • Posts 13,725
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs
  • Re: querystring probelm?

    10-27-2008, 6:08 AM
    Answer
    • Member
      53 point Member
    • kerry-jiang
    • Member since 08-09-2006, 8:37 AM
    • Posts 12

    I suggest you don't use query string to pass important information like user name and password.

    Please place them in session or other server side object.

    If you prefer to query string, I suggest you use https to secure your request.

    A DotNot Fans
    Welcome to my ebook store
    http://www.drivehq.com/folder/p43383.aspx
  • Re: querystring probelm?

    10-27-2008, 7:32 AM

     I do agree with kerry

  • Re: querystring probelm?

    10-27-2008, 9:51 AM
    Answer
    • Participant
      1,521 point Participant
    • Deleo
    • Member since 11-04-2007, 10:33 AM
    • Posts 309

    Agree, never ever use querystring for sensitive information, and never ever hide them in hidden fields or viewstate.

    Always encrypt and store them in either session or cookie or custom (sql or files).

    You can however use querystring for validation of a username or password. Example (not a good scenario):

    A user is prompted for username and password, then submits the form. The page is redirected to another page for validation and sends the user name and password in the URL. Be aware that the user name and password is encrypted using a one way encryption hash with a little extra spice (your own phrase). At the validation side, you extract the username and passord from the database and hash this the same way you did on the latter page. Then you compare to the value, the one send in query string and the one generated at the validation page. If they match, then voila! if not, incorrect username or password sent back to the user.

     

Page 1 of 1 (5 items)