On my Drupal 7 site, I am using the Prepopulate module to pre-fill a field based on a parameter in the URL for authenticated users.

An example of a URL is:


When accessing the URL as an anonymous user, Context shows the login block.

After logging in, it redirects the user back the same URL BUT without the prepopulate info.

Simply something like:


Is there anything that can be done so that the information in the URL is not lost after logging in?

2 Answers 2


You can use a destination parameter in URL to retain those values. There is a good read on drupal.org (https://www.drupal.org/docs/7/theming/overriding-themable-output/how-to-add-a-destinationurl-to-the-request-new-password)

Let me know if you need any help.


I have found a solution.

Instead of the following URL that was posted originally:


I will send the User to the Login Page but with the Destination paramater set to that URL so that it retains the prepopulate data.

This is an example url:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.