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?


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.