

Ask HN: How and why does Twitter trap its users? - solipsist

As I'm sure many of you have noticed, when you click on a link to Twitter you are unable to navigate back to the page that gave the link. That's because Twitter somehow disallows you from doing so when pressing the back button and instead keeps you on twitter.com.<p>For example, look at this article: http://www.wired.com/epicenter/2011/01/twitter-let-the-tweets-flow/<p>Then click on the link at the top of the 3rd paragraph that says "<i>#jan25 movement</i>". You should not be able to return to the Wired article unless you click the back button a few times repeatedly. Otherwise, you will alternate between the url's <i>https://twitter.com/#</i>, <i>https://twitter.com/search/%2523jan25#</i>, and <i>https://twitter.com/search/%2523jan25#search?q=%2523jan25</i>. This seems to always be the case when an article links to a Twitter page without opening a new window/tab.<p>As this is obviously quite frustrating, I was wondering why they have chosen to do it. It'd also be great to hear a technical answer on how they do it if it's not too complicated.
======
dacort
I can click back just fine on Chrome...

Wikipedia annoys me like this with the mobile web client. If I click through a
Google result to wikipedia, it redirects me to m.wikipedia.com and I have to
hit back twice to get to Google.

~~~
solipsist
I'm running Safari 4, just for your information

~~~
dacort
Odd, Safari 5.0.3 (6533.19.4) works fine for me.

~~~
solipsist
My mistake, I have Safari 5.0.3 as well. However, I've done some more testing
and it seems as if the "bug" only occurs when you're logged out of Twitter.
Let me know if that's the same for you.

~~~
dacort
Ah yes, I can confirm that. It's totally hosed when you're logged out since it
redirects to the logged-out search page, instead of the integrated one when
you're logged in. It also breaks the parameter encoding when it redirects.
Nice.

------
solipsist
A couple more details from some experiments I've done:

    
    
      • This behavior does not appear in Google Chrome
      • It does appear in Safari 5.0.3, but only when you're logged out of Twitter

------
benjoffe
This problem occurs when redirects are created in javascript by assigning a
url to the location object. If instead they use location.replace(href); then
no extra item will appear in the history stack and the back button will work
as intended.

------
atgm
I passed this on to a friend who works at Twitter, who e-mailed it up the
chain... so hopefully we'll get a response at some point.

~~~
solipsist
Wow! Thank you for doing this. I'm really looking forward to hearing if they
have something to say. Please keep us updated with the info that you're
allowed to disclose.

~~~
atgm
No problem, but don't get your hopes up! We'll see if anything comes back.

Maybe someone from Twitter will post here...

