Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum length of a querystring in asp.net

I know that the maximum length of a querystring varies by browser. Internet Explorer can have a maximum of 2048 characters.

If I perform a URLEncode in my code, will those encoded characters be taken as extra characters?

For example, suppose I have two textboxes. Before passing the values of the textboxes through the querystring, I perform HttpUtility.UrlEncode(TextBox2.Text) and then I pass those textbox values to another webpage through the querystring.

Suppose the URL may look like this: WebForm2.aspx?Username=Kutti&Password=Pa%26%26word.

Will that encoded thing, %26%26 has been taken as extra characters in the URL?

In other words, will it take Pa%26%26word as same characters in Pa&&word?

like image 603
Kutti080808 Avatar asked Nov 11 '22 17:11

Kutti080808


1 Answers

Yes, each character will be counted, even if it is arise due to encoding.

A suggestion for good code and security. Always try to limit your password till login page. Check the user's credentials and move on with some session variable for page to page authentication and authorization. Never pass password in the url, I would not even pass by userId.

like image 50
Shreyash Maheshwari Avatar answered Nov 14 '22 21:11

Shreyash Maheshwari