In my asp.net web application, on page load, I grab the current page URL and save it in a session variable to keep track of which page the user is on so that they can return to it if they are in the admin area, do some navigation around etc. Then they can press the return button and will be sent to the page on which they were, before entering the admin.
All this works in IE8; however, in FF and Chrome, when in admin, the backlink is redirected to the 404 user page that I have for the web application.
For testing purposes, I added the code that I wrote below with my page load event:
Response.Write((string)Session["navurl"]);// displays "http://somedomain.com/customerror/default.aspx" Session["navurl"] = currentUrl;//ex. currentUrl = "http://somedomain.com/contact/" Response.Write((string)Session["navurl"]);//ex. currentUrl = "http://somedomain.com/contact/"
Again this works without problems in IE, but in FF and Chrome on the page load, the session variable displays a 404 page link, and after setting it, the correct link is displayed. I used a violinist to see what happens, and Chrome throws 404 in the GET header for the favicon.ico file, which I do not use in this web application.
I added the faviocon file and the link in the site.master file, and Chrome and FF now work fine; I'm still not sure why this is happening. Does anyone have any idea why and how my Session variable is being overwritten by Chrome or FF?
As a side note, I stepped through the debugging process, and currentUrl is the correct URL.
Mark
source share