Redirecting user back to previous screen

After browser session timeout, the user is now redirected back to the previous
screen upon login.
Also added a non regression unittest.

Change-Id: I995bc217803805364967688e9b896b9b54583b36
Closes-Bug: #1201619
Merge "Redirecting user back to previous screen"