1.2.1 REDIRECT_AFTER_LOGIN Not Working on Item Page

Discussion in 'General Support' started by scottw, Nov 24, 2016.

  1. scottw

    scottw New Member

    Joined:
    Oct 5, 2011
    Messages:
    21
    Likes Received:
    0
    When someone logins from an item page, they get forwarded to the REDIRECT_AFTER_LOGIN page that is in user_login.php rather than remaining on the item page the were viewing.

    Does anyone know a way to fix this so if someone logins while looking at a live auction item they get redirected to the same item (stay on the same page)?

    I believe there is code at the top of item.php that is suppose to do this however it is not working on my site.

    Thanks
     
  2. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,145
    Likes Received:
    247
    It's always been like that. You get redirected to the user_login.php page and then to the user_menu.php page.

    I wouldn't know how to do this but, I do see this in the item.php page around line 28:
    PHP:
    $_SESSION['REDIRECT_AFTER_LOGIN'] = $system->SETTINGS['siteurl'] . 'item.php?id=' $id;
    This might be connected to the common.php page around line 75.
    PHP:
    // delete REDIRECT_AFTER_LOGIN value automatically so you are never forwarded to an old page
    if (isset($_SESSION['REDIRECT_AFTER_LOGIN']) && !defined('AtLogin')) {
        unset(
    $_SESSION['REDIRECT_AFTER_LOGIN']);
    }
    In the user_login.php page around line 110 I see this:
    PHP:
    if (isset($_SESSION['REDIRECT_AFTER_LOGIN'])) {
                    
    $URL str_replace('\r'''str_replace('\n'''$_SESSION['REDIRECT_AFTER_LOGIN']));
                    unset(
    $_SESSION['REDIRECT_AFTER_LOGIN']);
                } else {
                    
    $URL 'user_menu.php';
                }
    I wish I could help further but, I don't how to at this time.
     

Share This Page