asp page redirecting to mvc application which uses cookieless session

379 views Asked by At

I have a classic ASP page and an MVC3.0 application using Cookieless session.

When user tries to access the ASP page I have to redirect from the asp page to MVC application along with the querystrings . So i have the following code in the ASP page.

//////////////////

Dim sURL

sURL = "/MVC/xyz?" & Request.QueryString

Response.Redirect(sURL)

////////////////////////////

The ASP application and the MVC application are hosted under the same domain. When I try to access the ASP application using http:\domain\wsd.asp it redirects to http:\domain\mvc\xyz\s(xccxzcxzzxczxczxczxxczxc) where s(xccxzcxzzxczxczxczxxczxc) is the session id.

But when i try to access the asp application with some querystring like http:\domain\wsd.asp?querystring=ffg it doesn't redirect to the MVC application and throws an error Internet explorer cannot display the webpage.

However when i use the url http:\domain\mvc\xyz?querystring=ffg directly into the browser, it properly redirects by appending sessionid to the url.

When i make my MVC application to use Session with Cookies, the redirection from asp with or withoout querystrings works fine.

Please help me with this issue.

Thanks!!

1

There are 1 answers

0
Ajay Suwalka On

Add cookieless key and set it to UseCookies

<authentication mode="Forms">
  <forms loginUrl="~/YourLoginUrl" timeout="2880" cookieless="UseCookies" />
</authentication>