Add Variable Parameters To Any Request

Let me outline the problem. I have embedded pretty URLs into my application. E.g. user can access site using:



I would like to add silent-login feature. E.g. when I send newsletter to the users, URLs look like following:

When user follows the link, they get logged in and redirected to

The question: how technically implement the idea?