Body: <p>This chunk of <a href="https://github.com/civicrm/civicrm-joomla/blob/c2b8d467123ea7ad424daeff257eccca50e0ec49/site/civicrm.php#L51" rel="nofollow noreferrer">code</a> requiring a session on a POST request causes call backs from various 3rd party providers to fail. It has an exception for payment IPNs (civicrm/payment/ipn).</p>
  <pre><code>  // check and ensure that we have a valid session
    if (!empty($_POST)) {
      $urlStart = substr(stripslashes(CRM_Utils_Array::value('task', $_GET)), 0, 19);
      // the session should not be empty
      // however for standalone forms, it will not have any CiviCRM variables in the
      // session either, so dont check for it
      if (empty($_SESSION) &amp;&amp; $urlStart != 'civicrm/payment/ipn') {
        $config = CRM_Core_Config::singleton();
        CRM_Utils_System::redirect($config-&gt;userFrameworkBaseURL);
      }
    }
  </code></pre>
  <ol>
  <li>Is this code block necessary?</li>
  <li>If so, is there a way to add other paths as exception?</li>
  </ol>
  <p>Here are a couple of extension I have noticed that fail.</p>
  <ul>
  <li><a href="https://github.com/teamsinger/uk.teamsinger.civicrm.mailgun" rel="nofollow noreferrer">https://github.com/teamsinger/uk.teamsinger.civicrm.mailgun</a> (civicrm/mailgun/drop)</li>
  <li><a href="https://civicrm.org/extensions/twilio-sms-provider" rel="nofollow noreferrer">https://civicrm.org/extensions/twilio-sms-provider</a> (civicrm/sms/callback)</li>
  </ul>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-09T21:08:25.863Z
Comments.Text: Not an answer to the main question, but that mailgun extension is quite old.  You might be interested in https://github.com/artfulrobot/mailgunny
Comments.UserDisplayName: Aidan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-09T21:21:07.247Z
Comments.Text: That's awesome! Thank you. I have been wondering how long the legacy webhooks in Mailgun would survive.
Comments.UserDisplayName: David Hayes
Tags: <joomla><webhook>
Title: Webhooks/Callbacks in Joomla
ThreadText: # Webhooks/Callbacks in Joomla
  
  (Asked by: username_0 on 2020-11-09)
  
  This chunk of [code](https://github.com/civicrm/civicrm-joomla/blob/c2b8d467123ea7ad424daeff257eccca50e0ec49/site/civicrm.php#L51) requiring a session on a POST request causes call backs from various 3rd party providers to fail. It has an exception for payment IPNs (civicrm/payment/ipn).
  
  ```
    // check and ensure that we have a valid session
    if (!empty($_POST)) {
      $urlStart = substr(stripslashes(CRM_Utils_Array::value('task', $_GET)), 0, 19);
      // the session should not be empty
      // however for standalone forms, it will not have any CiviCRM variables in the
      // session either, so dont check for it
      if (empty($_SESSION) && $urlStart != 'civicrm/payment/ipn') {
        $config = CRM_Core_Config::singleton();
        CRM_Utils_System::redirect($config->userFrameworkBaseURL);
      }
    }
  
  ```
  
  1. Is this code block necessary?
  2. If so, is there a way to add other paths as exception?
  
  Here are a couple of extension I have noticed that fail.
  
  * <https://github.com/teamsinger/uk.teamsinger.civicrm.mailgun> (civicrm/mailgun/drop)
  * <https://civicrm.org/extensions/twilio-sms-provider> (civicrm/sms/callback)
  
  **Tags:** joomla, webhook
  
  > **Comments:**
  > **username_1**: Not an answer to the main question, but that mailgun extension is quite old.  You might be interested in https://github.com/artfulrobot/mailgunny  
  > **username_0**: That's awesome! Thank you. I have been wondering how long the legacy webhooks in Mailgun would survive.  
  
  ---
  
  ## 0 answers
  
  