Body: <p>We have a module that has an action controller method that a third party website posts data to.</p>
  <p>We can see that often, we can't save the data and there is an error &quot;<code>Request didn’t meet the user agent and IP requirement for maintaining a user session</code>&quot; in our web log.</p>
  <p>I'm guessing it's this config setting &quot;<code>requireUserAgentAndIpForSession</code>&quot; but no idea how to turn that off for a specific request?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-01T16:00:51.463Z
Comments.Text: Try setting the value to `'requireUserAgentAndIpForSession' => (!isset($_SERVER['REQUEST_URI']) || $_SERVER['REQUEST_URI'] != '/your/action/contoller/function')`, which would turn it off for that specific request only
Comments.UserDisplayName: Joshua M
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-01T16:04:34.287Z
Comments.Text: That is what I have been mulling over, just wondered if there was anything that felt less hacky!
Comments.UserDisplayName: John
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-01T16:06:18.473Z
Comments.Text: This was the official line back in 2014–https://craftcms.stackexchange.com/a/4554/6147. I can't see any reason why it's changed, though maybe you can set it on the controller level as `public $requireUserAgentAndIpForSession = false`?
Comments.UserDisplayName: Joshua M
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-01T16:09:06.540Z
Comments.Text: Ah ok! I hadn't seen that one. Lovely ta!!
Comments.UserDisplayName: John
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-04T23:28:57.070Z
Comments.Text: Someone want to add that as an official answer? :P
Comments.UserDisplayName: Brad Bell
Tags: <controller><modules>
Title: Request didn’t meet the user agent and IP requirement for maintaining a user session when website posts to our action URL
ThreadText: # Request didn’t meet the user agent and IP requirement for maintaining a user session when website posts to our action URL
  
  (Asked by: username_0 on 2021-02-01)
  
  We have a module that has an action controller method that a third party website posts data to.
  
  We can see that often, we can't save the data and there is an error "`Request didn’t meet the user agent and IP requirement for maintaining a user session`" in our web log.
  
  I'm guessing it's this config setting "`requireUserAgentAndIpForSession`" but no idea how to turn that off for a specific request?
  
  **Tags:** controller, modules
  
  > **Comments:**
  > **username_1**: Try setting the value to `'requireUserAgentAndIpForSession' => (!isset($_SERVER['REQUEST_URI']) || $_SERVER['REQUEST_URI'] != '/your/action/contoller/function')`, which would turn it off for that specific request only  
  > **username_0**: That is what I have been mulling over, just wondered if there was anything that felt less hacky!  
  > **username_1**: This was the official line back in 2014–https://craftcms.stackexchange.com/a/4554/6147. I can't see any reason why it's changed, though maybe you can set it on the controller level as `public $requireUserAgentAndIpForSession = false`?  
  > **username_0**: Ah ok! I hadn't seen that one. Lovely ta!!  
  > **username_2**: Someone want to add that as an official answer? :P  
  
  ---
  
  ## 0 answers
  
  