Set Cookie Using Trigger Failing

(Lewis) #1

I’ve set up a trigger to create a cookie when a specific Squiz custom form is submitted. I’ve set the trigger to fire on ‘Form Submission Created’ as I guess this is the definitive end point - the form is fully submitted.

Unfortunately, when the form is submitted nothing comes through in the browser’s developers tools, showing the cookie being sent.

Any ideas?

(Iain Simmons) #2

Hi Lewis,

There’s also the Form Submission Completed trigger event, that only occurs after a successful submission.

Can you please elaborate a bit on what you intend to use the cookie for, and the other settings in the trigger? (Events, Conditions, Actions and whether you have things like ‘Ignore Permissions’ checked?)

– iain

(Lewis) #3

Hi @isimmons. Thanks for the reply!

I’m trying to create a cookie banner - yuh know, ‘we use cookies’ etc for a satellite site. I’ve tried a couple of other things yesterday too but no luck.

I’ll give your suggestion a go. I’m thinking it’s likely to be being blocked on our network or else it’s some sort of permission thing! :thinking:

(Lewis) #4

Just realised ‘Form Submission Completed’ is one I tried already. I’ve tried those two (Form Submission Completed/Form Submission Created) in different combinations but no luck. I’ve tried publishing the page where I’ve nested the form, I’ve tried going direct to the Custom Form and I’ve tried setting the cookie domain and path in the trigger’s settings but still nothing.

I even tried off out network, on my own install of Squiz demo VM but it still doesn’t work so I’m pretty sure it’s a setting somewhere that is wrong now @isimmons

(Iain Simmons) #5

Is the cookie http only and are you accessing it via JS?

It might actually be easier to just use JS to set and get the cookie value. Then you don’t really have to worry about caching.

(Lewis) #6

I’m not accessing it through JS but it is being served over http.

I would rather have server side where I can, just means we’re less reliant on individual’s browsers although I guess I could use SSJS @isimmons?