2

I have an application which is on a shared server. I am facing issues while setting the cookie. Here is the code:

<cfcookie name="CFID" value="#cfid_local#">
<cfcookie name="CFTOKEN" value="#cftoken_local#">

The error which I am getting is:

Failed to set cookie. ColdFusion is unable to add the cookie you specified to the response.

To fix this issue, I need to Navigate to the "Memory Variables" page under the "Server Settings" menu. Un-Check "Disable updating ColdFusion internal cookies using ColdFusion tags/functions." and select the "Submit Changes" button.

But as my application is on shared server. This change cannot be made. Can any one let me know that how can I fix this programmatically?

Leigh
  • 28,765
  • 10
  • 55
  • 103
Abdul Rauf
  • 763
  • 2
  • 8
  • 28
  • If you find yourself needing to set the internal ColdFusion cookies then you are doing something wrong. – Miguel-F Jun 07 '17 at 11:57
  • @Miguel-F. In fact, i have two application.cfc. one is on root and other is in admin folder. I need to share the session cookies with admin application. So i am setting it again. That is my requirement. – Abdul Rauf Jun 07 '17 at 12:11
  • 3
    If you use the same application name in both Application.cfc files the session will be shared without you having to do anything. You should never have to modify those cookies yourself. If for some reason you cannot name the applications the same then I would recommend storing the information that you are after into a database that can be retrieved from the other application. – Miguel-F Jun 07 '17 at 12:24
  • @Miguel-F. Thanks. Let me check that if the first case will work for me.. Otherwise i will try database approach. – Abdul Rauf Jun 07 '17 at 12:34

0 Answers0