0

hoping someone might be able to see exactly what this weird url is I am getting. Pretty standard setup, ASP.NET MVC 4.5, standard route, works fine, debugging local and also works deployed locally to an IIS site, but then I deploy to an internal DEV server, which I have deployed other APPS to and work fine, I got a URL like the following;

HTTP-SERVER-NAME-SITE-NAME/(F(0QaIzI5Hs7HNb1NFrdjwD01aXryW70GB7x3wmgbZpmA4zt2P4xX33B7qMxDQzCPpnVfZMlIwQ4p0CYANRXC_fzZIFzrSPbMB1_JYGvjk8ARmA3k4TXRwa6-pnrHX94sc0))/

I have removed the names of the server/site, just because I didn't want to show them, that Url is generated after the user logs in and this is the return URL from logging in, all fine except for the funky string which has been generated, the string is same FOR every session, there is another clue, I don't think this is an issue with URL.Content it seems like a server related deployment issue, but freaking me, can't work out at the moment what is generating the weird URL.

Development server is the following; Windows Server 2003 R2

BUt I have deployed other Apps to this site MVC Apps, and have not had this issue, just seems to be this site, the URL is correct, because it is redirecting to the Route Defaults which is actually, ~/Order/Index, hence the the URL is empty after the last slash.

UPDATE: Sorry I just double checked and logged in as a different user and also the same user the that funky string is changing, is that the Session ID ? Just checking to see if it is.

Imad Alazani
  • 6,688
  • 7
  • 36
  • 58
  • Well it isn't the sessionid, completely different, I have also already tried, deleting the site and installed the App again into a different site with a different site name, no dice. – Michael Pine Sep 02 '13 at 00:41
  • Have you tried comparing the web.config and IIS settings with the other deployed MVC apps that are working correctly? – asymptoticFault Sep 02 '13 at 02:11
  • thanks :) just going through that now, having said what I did before, this is the first ASP.NET/MVC 4 the others were older versions, but it seems to be specific to this server, which yes is an old server 2003 R2, but this still seems like a basic issue. – Michael Pine Sep 02 '13 at 02:16
  • ok getting somewhere, so I just found this post http://forums.asp.net/t/1735215.aspx/1?Strange+URLs+generated+from+routes and it seems and as in my case that all of my bad Url's start with an F that it is something to do with Forms Authentication, which yes is what I am using. For my Forms Authentication configuration I have Annonymous access enabled and Windows Authentication is turned off. – Michael Pine Sep 02 '13 at 03:54

2 Answers2

1

sigh well that was an interesting experience but I guess if you learn something, then maybe not a completely wasted day.

cookieLess="UseCookies" solved this for me, I don't remember ever having this set anywhere and it was all working ok, but setting this on the deployed version on the DEV server fixed the issue and stopped the web app from appendning the Forms Authentication ticket to the Url, interesting, at least I went over all my web configuration and everything else looks ok.

0

The Session ID is added to the URL by ASP.NET in this format when the session state is configured to be stored without using a browser cookie:

<sessionState cookieless="true" />

This setting is in web.config, but it also possible to be in machine.config. It's possible that it is configured in machine.config and the other sites you deployed on this server were not setup to use session, or it's in the web.config of your current project. See this MSDN article for more information: Cookieless ASP.NET.

Rich
  • 896
  • 6
  • 15
  • It actually looks like the Forms Authentication ticket instead of the Session Id. http://stackoverflow.com/questions/12228704/ie10-injects-token-into-net-mvc-links – Tommy Sep 02 '13 at 04:11
  • Sorry yes I accepted the answer but you are correct it is the Forms Authentication ticket because it starts with the "(F", so yes that was it, only just posted my answer because I have low cred, so I couldn't answer it earlier when I found the problem :) – Michael Pine Sep 02 '13 at 22:43
  • Ah, thanks for the update and I'm sure it's a relief that you finally figured it out! – Rich Sep 02 '13 at 23:50