I'm facing a weird problem. I'm working on magento mobile theme (1.7). We have a header with a checkout icon pointing to: http://sitename.com/checkout/onepage/
When the user visits the site, a popup is shown for login. When he logins, the page simply reloads and if he has cart items, we show the checkout icon which links to the above given url.
The problem is, for the first time when user clicks the link, it redirects to http://sitename.com/checkout/cart/.
The cart page again has the same link. If the user clicks again on the checkout link, it moves to proper url: http://sitename.com/checkout/onepage/
I'm not able to find why it is moving to the /cart/ url for the first time instead of going to /onepage/. And why it is moving to /onepage/ for any other time.
Please help me on this