When drupal_access_denied is called the function rewrites the actual path from the request and then sets it to the path of the access denied page setting, and after the rewrite there is no way to determine the path that was generated from the request. This is a problem if you wish to display a login form for the content of the access denied page. If you log the user in the form will redirect them to the path for the access_denied page, and not be able to redirect the user to the path they were at the beginning of the request.

Comments

gpk’s picture

I think you have tripped over #292565: Regression: Can't set /user to 403 page (was: login destination is broken), which is still waiting to be applied to 7.x.

naxoc’s picture

Status: Active » Closed (duplicate)