APIs & Integrations

Gaston_Yelmini
Membro

Error 500 when posting form from incognito mode on Chrome (hubspotutk)

Hi!

Our server is getting a 500 error when a form is posted from incognito mode in Chrome. This error references the cookie "hubspotutk" as undefined.

[2018-08-11 19:56:09] production.ERROR: Undefined index: hubspotutk {"exception":"[object] (ErrorException(code: 0): Undefined index: hubspotutk at /home/forge/latio.co/app/Http/Controllers/Programs/Lead$ [stacktrace]

Has anyone had the same problem?

Thanks!

0 Avaliação positiva
4 Respostas 4
benvanlooy
Top colaborador(a) | Parceiro Platinum
Top colaborador(a) | Parceiro Platinum

Error 500 when posting form from incognito mode on Chrome (hubspotutk)

Make sure your hubspot code is on the page & make sure the cookie is set.

 

However, if you want to get around this for now, you can always check if the cookie is set & then pass the value or just an empty value..

$hubspotutk = isset($_COOKIE['hubspotutk']) ? $_COOKIE['hubspotutk'] : '';

 

 

Derek_Gervais
Alunos da HubSpot
Alunos da HubSpot

Error 500 when posting form from incognito mode on Chrome (hubspotutk)

Hi @Gaston_Yelmini,

I'm not particularly familiar with PHP, but after you set the variable can you check to see if it has a value? If there is no hubspotutk value, you shouldn't include it in the form submission.

0 Avaliação positiva
Derek_Gervais
Alunos da HubSpot
Alunos da HubSpot

Error 500 when posting form from incognito mode on Chrome (hubspotutk)

Hi @Gaston_Yelmini,

If the form is being posted from an ingocnito browser, it's possible that the visitor doesn't have a hubspotutk cookie. While this should not cause a 500 error response from HubSpot, it's possible that it's causing an error in your code since you're explicitly setting the $hubspotutk variable. Can you try the submission in an incognito window after confirming that the hubspotuk cookie exists using the Chrome dev tools?

0 Avaliação positiva
Gaston_Yelmini
Membro

Error 500 when posting form from incognito mode on Chrome (hubspotutk)

Hi @Derek_Gervais, thank you for your answer.

I made a post and I can see that the hubspotutk cookie is missing. How should I handle this when its missign?

Thank you again.

0 Avaliação positiva