views:

10

answers:

0

Since last week I've had a really odd issue with PageMethods and the back button which i've never seen before.

Essentially, I have a 'home page' which on document.ready (using jQuery), loads some data through PageMethods, and then renders a list - from which you can click through to a details page about the item. In general use, it works fine. However, using the back button after clicking through (ie: going back to the home page), it throws a PageMethods error. The browser's 'authentication required' prompt appears, and if you click cancel, the server returns a 401. The error returned by PageMethods on the client side is 'authentication failed'.

Just FYI, the application is using ASP.NET forms authentication. The weird thing is, this happens as soon as you click the link and click back. It's not like the authentication cookie has expired or anything, and if you click cancel when the prompt appears and refresh the page, it works fine. I just can't work out what is going on.

I've tried disabling caching on the page [as I thought it was something to down with some browsers' caches of the DOM), but the same thing happens.

One workaround i've had is to redirect the page to itself if the PageMethods error is 'authentication failed', which does work - but only when you cancel the authentication prompt. Obviously the prompt appears, which is not ideal.

I don't understand it, and the user is clearly authenticated. Does anyone have any idea which might be happening?

It's happening in Chrome, Firefox, and IE.