30 January 2012

Always encode the return URL

Sometimes, we need to put some url as a parameter in the page url, example:

https://open.login.yahoo.com/openid/yrp/signin?returnUrl=http%3A%2F%2Fmail.yahoo.com&rpcrumb=TzwDznuzRzH&.src=ym

The value of parameter "returnUrl" is an encoded url (http%3A%2F%2Fmail.yahoo.com)

So, whenever you want to put a URL as a parameter, you have to URL encode it.

(you can use JS function encodeUrlComponenet

No comments: