Is it hard to fix? Is it expensive on the server? Anything else?
Well, in layman's terms, when you hit the "Back" button, you're not asking the server for a new page. Instead, you're just merely fetching the source which was downloaded a second ago. There tend to be a few exceptions, such as when the browser has loaded too many pages, but this is how it theoretically works.
So why is it hard to fix? There are two ways to fix it:
While this is possible, it's also a bit of a questionable technique, because the number of votes will accumulate over time. And if we clear them after 5 mins/1 day/1 year, what happens if I start clicking back on my ideal all-remembering browser? I'd get some cases where it remembered my votes, and some cases where it didn't. That creates discrepancy—at least it's consistent right now.The more I think about this, the more I think it might work. Votes shouldn't take that much space—key (with post ID) could fit in 2 bytes, value in 2 bits (1,0,-1), nor should it be too much of a strain on the browser.
It's not a bug.
When you hit 'back', the browser reloads the page as it was for your last POST to that page. (Or your last 'GET' from that page). Since an ajax vote doesn't refresh the entire page, you're not going to see that vote updated.
It's the way the web works, without it the back button would be useless, because you could never see the state of a page as it was when you first visited it.