Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Passing parameter with response.redirect without showing in url

I am redirecting to a page in my asp.net application using which passes a parameter in the url.

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

Is there a way to send execution or direct to that page and pass the paremeter without showing it in the url? Thanks.

like image 748
Lucky Luke2 Avatar asked May 28 '13 07:05

Lucky Luke2


People also ask

Does response redirect stop execution?

When you use Response. Redirect("Default. aspx",true ) which is by default true then the execution of current page is terminated and code written after the Response. Redirect is not executed instead of executing code written after the Response.


2 Answers

url parameters are very insecure. it is a simple string that goes visible to everyone. you should either encrypt it or use sessions. if it is an id you are passing in the url, you can use uniqueidentifier as an id.

I think the best and easiest way is to send it via Sessions.

like image 65
Arif YILMAZ Avatar answered Sep 18 '22 13:09

Arif YILMAZ


You can't hide values sent in query string, but you can encrypt the values, if you want them not to be readable. OR Instead of simple redirection you will have look for other option to navigate to next page

How to: Pass Values Between ASP.NET Web Pages

like image 24
Raab Avatar answered Sep 20 '22 13:09

Raab