the access check variable in the querystring is what controls whether you will be redirected to the previous page.
if the page is not passed to the login page using the accesscheck variable, the login page has no way to know what the previous page is.