Redirect user back to the private page after they have logged in On my site I have a private page that can only be accessed when the user is logged in. If they aren't logged in they are directed to the login page.

I want to redirect them back to that page after they've logged in

I've tried a lot of solutions already listed on here including: logindestination and logintoboggan.

Every time the person logs in they are always directed to their user page no matter what I change in logintoboggan/logindestination

I tried creating a rule but was getting a 404. I'm not sure what to put in the PHP Evaluation field in the redirect action. 

I've added this to my template file

global $user;
    if ($user-&gt;uid == 0){
        print l("Login","user/login",array('query' =&gt;     drupal_get_destination()));
    }
else{
print l("Logout","user/logout",array('query' =&gt; drupal_get_destination()));
}   


And then in logindestination I added

$destination = drupal_get_destination();
print $destination;


What am I doing wrong??
For logindestination to work properly all you need to do is add an entry using &lt;current&gt; as the redirect location.  Leave the "Redirect to Page" option as Internal page or external URL.  This configuration will send a user back to the page they were trying to access before being sent to the login page.