Skip to main content
Improving question title and body text to make it more clearer.
Source Link

why doesnt Why doesn't my token redirect to the previous url?

I thought I could use the following code:

<a href="user/login?destination=<?php print token_replace('[current-page:url]'); ?>a link</a>

to redirect users to the page they were on after log in, but it doesn't seem to work.

I can see the correct url on the login page, e.g.:

mysite/user/login?destination=the url of the page I was on

mysite/user/login?destination=the url of the page I was on

but when I login I am still redirected to mysite/users/mymysite/users/my user name.

why doesnt my token redirect to the url?

I thought I could use

<a href="user/login?destination=<?php print token_replace('[current-page:url]'); ?>a link</a>

to redirect users to the page they were on after log in, but it doesn't seem to work.

I see the correct url on the login page e.g.

mysite/user/login?destination=the url of the page I was on

but when I login I am still redirected to mysite/users/my user name

Why doesn't my token redirect to the previous url?

I thought I could use the following code:

<a href="user/login?destination=<?php print token_replace('[current-page:url]'); ?>a link</a>

to redirect users to the page they were on after log in, but it doesn't seem to work.

I can see the correct url on the login page, e.g.:

mysite/user/login?destination=the url of the page I was on

but when I login I am still redirected to mysite/users/my user name.

Source Link
olisb
  • 145
  • 10

why doesnt my token redirect to the url?

I thought I could use

<a href="user/login?destination=<?php print token_replace('[current-page:url]'); ?>a link</a>

to redirect users to the page they were on after log in, but it doesn't seem to work.

I see the correct url on the login page e.g.

mysite/user/login?destination=the url of the page I was on

but when I login I am still redirected to mysite/users/my user name