We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27330
    • 884 Posts
    Hi everyone,
    I'm trying this code on evo site,
    if I remove the && (!isset($_COOKIE["mobileDevice"])) cookie check it works fine and redirect to mobile site.

    The cookie is created on the mobile site and I can see it in the document Info.

    <?php
    define(MOBILE_PATH, "assets/snippets/mobiledetect/");
    $output = "";
    include($modx->config['base_path'].MOBILE_PATH.'mobile_device_detect.php');
    
    $mobile = mobile_device_detect();
    if  ($mobile==true)  && (!isset($_COOKIE["mobileDevice"]))
           {
            header('Location:http://m.mydomain.com/');
           }
    exit;
    ?>
      • 27330
      • 884 Posts
      if ( !isset($_COOKIE["mobileDevice"]) && ($mobile==true) )