ASP.NET Passing a parameter using response.redirect without displaying in the url

I redirect the page to my asp.net application, using which passes the parameter to the URL.

HttpApplication app = (HttpApplication) sender; HttpResponse response = app.Context.Response; app.Response.Redirect("~/auth/SignOn.aspx?capath=" + capath); 

Is there a way to submit execution or go to this page and pass the parameter without showing it in the url? Thanks.

+6
source share
3 answers

URL parameters are very insecure. it is a simple line that becomes visible to everyone. you must either encrypt it or use sessions. if this is the identifier you pass in the url, you can use uniqueidentifier as id.

I think the best and easiest way is to send it through sessions.

+4
source

You cannot hide the values ​​sent in the query string, but you can encrypt the values ​​if you want them not to be read. OR Instead of simply redirecting, you will look for another way to go to the next page.

How to pass values ​​between ASP.NET web pages

+3
source

if your site is distributed on many computers, you must use a cookie in order to skip the session skip

write cookie

 HttpCookie testCookie = new HttpCookie("capath"); testCookie.Value = HttpUtility.UrlEncode(capath); Response.Cookies.Add(testCookie); 

read cookie

 if (Request.Cookies["capath"] != null) { HttpCookie getCookie = Request.Cookies.Get("capath"); } 
0
source

Source: https://habr.com/ru/post/945988/


All Articles