Adding code to Login.php

Discussion in 'Customization & add-ons' started by JimmyStephans, Nov 11, 2011.

  1. JimmyStephans

    JimmyStephans Member

    Joined:
    Mar 24, 2004
    Messages:
    95
    I have moved to a new host so that my site can be on a content delivery network. Yesterday the host sent this message:
    -----------------------------------------------------------------------------------------------------
    Can you ask amember support if they can add this functionality inside of the area where a member successfully logs in? Or ask them if its OK if we add this ourself. setcookie("primeauth",base64_encode(sprintf("%s:%s",$user,$password)));'

    ------------------------------------------------------------------------

    I put a ticket in, and Alex asked my why we need this, but I haven't heard more from him.

    Host wants an answer so we can decide if we going on the CDN or not.

    So, what do the experts here think? I know ZERO about PHP and all that stuff...
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Hi,
    Here is how this can be done. Create /amember/site.inc.php with this code:
    PHP:
    <?php
    setup_plugin_hook
    ("after_login""setcookie_after_login");
    function 
    setcookie_after_login($user){
        
    setcookie("primeauth",base64_encode(sprintf("%s:%s",$user['login'],$user['pass'])));
    }
    ?>
  3. JimmyStephans

    JimmyStephans Member

    Joined:
    Mar 24, 2004
    Messages:
    95
    Hello, Alexander, we have implimented the change as you described and now the host is requesting:

    "Can you please let them know that they need to change the CookieDomain from mysite.com to .mysite.com Can you please tell them to also change the CookiePath from /amember to /"

    Can you explain that or lead me in the right direction?

    Thanks!

Share This Page