TYPO3 FE login redirect to the page from which we come.

To set the front end login redirect to the page from which the user came, we can do the following steps.

Add the below code in the TS template.

#login redirect
[loginUser = ]
page.headerData.200 = COA_INT
page.headerData.200 {
10 = TEXT
10 {
typolink {
parameter = {$loginPid}
additionalParams {
data = getIndpEnv:TYPO3_REQUEST_URL
rawUrlEncode = 1
wrap = &referer=|
returnLast = url

Once this is done, we need to set the “referer” redirect in the flexform of the felogin extension and it should be at top.



That’s it.


Felogin logout redirect does not work

When we try to logout from an access restricted page, we will see either a 404 (Page not found) or a 401 (Authorization required) error.
This issue seems quite old, but unfortunately there are still some bugs when we use the Logout template of the felogin.

The issue is reproduceable even on Typo3 4.2.8, I am not sure if this is fixed on 4.3 onwards.

There is a patch that we can use to patch felogin as given on the following URL:

Due to various reasons it may not always be possible to patch.
In such circumstances it is wiser to use an alternate technique, such as creating the Logout link manually.
One such example is:

[loginUser = *]  

lib.logoutbox = COA
lib.logoutbox {
    20 = TEXT
    20 {
       data = TSFE:fe_user|user|username
       # link to account edit page
       stdWrap.typolink.parameter = 60
    30 = IMAGE
    30 {
        file = fileadmin/templates/images/logout.gif
        stdWrap {
             # Let us link to home page for logging out
             typolink.parameter = 1
             typolink.additionalParams = &logintype=logout
             wrap =  |


In this example I am displaying the logged in username (which links to user account page) followed by a working logout button.

– Here we are not using the felogin plugin.
– Do not link the logout button to any access restricted page.

The following page from Typo3wizard might be useful for displaying more user-details if needed: