Josue,
You can always pass return_url between pages.
This way you can be sure you have the proper page assigned to your variable
It would be great if you post your code here, then i could understand what you are trying to achieve.
anyway, if the previous page is only a .tcl page then you probably is using something like ad_returnredirect or a form.
Either way you could:
a) ad_returnredurect [export_vars -base "next-page" {return_url}]
*don't forget to add return_url in the ad_page_contract.
b) input type='hidden' name='return_url' value='$return_url'
or if you are using ad_form
...
{return_url:text(text)
{value $return_url}
}
...
Those were just ideas. As i said i need more details to guide you better.
I hope it helps
Cheers,