<p>Currently, no... it's an all or nothing thing and you'll have to disable it globally.</p>

CC BY-SA 3.0
2014-06-20T22:17:57.260Z
2014-06-20T22:17:57.260Z
Brad Bell
<p>I'm working on building a post-receive hook and a third party service's attempt to post data to a webhook keeps 302ing to the Craft login page when I attempt to use <code>EmailModel</code> and <code>sendEmail()</code>.</p>

<p>The only thing Craft logs during this failed transaction is a series of errors that read...</p>

<blockquote>
  <p>Someone tried to restore a session from a cookie without presenting an IP address or userAgent string.</p>
</blockquote>

<p>I noticed the <code>requireUserAgentAndIpForSession</code> setting in <code>UserSessionService-&gt;_checkVitals()</code>, disabled it, and of course the problem went away.</p>

<p>I'd prefer not to disable this setting in general—is there a way to programmatically unrequire it for a specific plugin receiving posts?</p>

<plugin-development><security>
Is it possible to disable `requireUserAgentAndIpForSession` for specific instances?
# Is it possible to disable `requireUserAgentAndIpForSession` for specific instances?

(Asked by: username_0 on 2014-06-20)

I'm working on building a post-receive hook and a third party service's attempt to post data to a webhook keeps 302ing to the Craft login page when I attempt to use `EmailModel` and `sendEmail()`.

The only thing Craft logs during this failed transaction is a series of errors that read...

> Someone tried to restore a session from a cookie without presenting an IP address or userAgent string.

I noticed the `requireUserAgentAndIpForSession` setting in `UserSessionService->_checkVitals()`, disabled it, and of course the problem went away.

I'd prefer not to disable this setting in general—is there a way to programmatically unrequire it for a specific plugin receiving posts?

**Tags:** plugin-development, security


---

## 1 answers

### Answer by username_1 on 2014-06-20. Score: 1 | Accepted answer

Currently, no... it's an all or nothing thing and you'll have to disable it globally.


---

