'No Anti-Cross Site Request Forgery cookie found in request' error on the Calendar control

  • 16 February 2021
  • 0 replies
  • 121 views

Userlevel 1
Badge +8

Issue

Date picker on the Calendar control stops working after setting the Date and Time format to use 'Thai (Thailand)' on the Calendar control and Anonymous Access is enabled on the View and Form. 

Error Code

From a network trace captured on the browser Developer Tools, you will see a 500 error on the CalendarAJAXCall.ashx request and inspecting the request shows this error is returned:

 

No Anti-Cross Site Request Forgery cookie found in request

 

23879i1E59720EA8770711.png

 

Under the Console tab, there is a Uncaught SyntaxError: Unexpected token '<' error"

23880i03ABEB189DA12B75.png

Resolution

Here are the workarounds available:

1. Don't enable Anonymous Access on both the View and Form.

 

2. Follow the steps below:

a. Make a backup of the K2 SmartForms Designer and Runtime web.config files located in the below locations:

  • %PROGRAMFILES%K2K2 smartforms Designer
  • %PROGRAMFILES%K2K2 smartforms Runtime


b. Edit the web.config and add this setting under the <appSettings> node:

<add key="AntiXSRF.IgnoreFilePathList" value="/Runtime/CalendarAJAXCall.ashx;" />

c. Save the changes.

d. Perform an IISRESET.

 

Additional Information

For workaround #2, this is specific for the Calendar control only and will keep the rest of the K2 site secure.

 

 


0 replies

Be the first to reply!

Reply