How to crypt my URL
-
Hello, To open many aspx pages in my application il use parameters and sometimes the user name and password as required. For instance :
Response.Redirect("subscribe.aspx?From=LoginUser&UserName=" & txtUserName.Text & "&UserEmail=" & txtEmail.Text & "&UserPassword=" & txtPassword.Text)
the probem is that after running this code the URL become :
Response.Redirect("subscribe.aspx?From=LoginUser&UserName="toto" &UserEmail=" toto@yahoo.fr"&UserPassword="totototo")
You undertand this is not a ggod thing because user can see theses information and worse google can record thes infos. Is there any way to crypt URL Informations? Thanks in advance
-
Hello, To open many aspx pages in my application il use parameters and sometimes the user name and password as required. For instance :
Response.Redirect("subscribe.aspx?From=LoginUser&UserName=" & txtUserName.Text & "&UserEmail=" & txtEmail.Text & "&UserPassword=" & txtPassword.Text)
the probem is that after running this code the URL become :
Response.Redirect("subscribe.aspx?From=LoginUser&UserName="toto" &UserEmail=" toto@yahoo.fr"&UserPassword="totototo")
You undertand this is not a ggod thing because user can see theses information and worse google can record thes infos. Is there any way to crypt URL Informations? Thanks in advance
There are many ways you can escape such a not too cool practice. 1. Put your parameters in a separate session object and access it on the other page, e.g.
Session[ "UserName" ] = "toto";
Session[ "UserEmail" ] = "toto@yahoo.fr";
Session[ "UserPassword" ] = "totototo";//redirect to your page like so:
Response.Redirect( "subscribe.aspx?From=LoginUser" );Go here and find out more of this stuff: http://msdn.microsoft.com/en-us/library/ms178581.aspx[^] 2. Put your parameters in a separate cookie object and access it on the other page, e.g.
Response.Cookie[ "UserName" ].Value = "toto";
Response.Cookie[ "UserEmail" ].Value = "toto@yahoo.fr";
Response.Cookie[ "UserPassword" ].Value = "totototo";Go here and find out more of this stuff: http://msdn.microsoft.com/en-us/library/ms178194.aspx[^] 3. Using the handy to manage Cache object: http://msdn.microsoft.com/en-us/library/aa478965.aspx[^] 4. You can keep it as you wanted by encrypting your parameters and you could: a. Convert to base64 http://msdn.microsoft.com/en-us/library/dhx0d524.aspx[^] b. MD5 hash http://msdn.microsoft.com/en-us/library/system.security.cryptography.md5.aspx[^] But again, you don't want to put sensitive information in your url as people can decode it, which is why i would recommend the first 3 options. Happy coding, Morgs