Coldfusion 9 cfscript cfcookie and cookie (script style) -
I am trying to set my cookie CFD and CFTOcen only in the CalledDeX 9 as HTTP ... < / P>
Here's what I have tried (not an error but did not work):
cookie.CFID = "# session.cfid #, httpOnly = 'true'" ; Cookie CFTOKEN = "# session.cftoken #, httpOnly = 'true'"; I have also tried (none ... and no error):
cookie.CFID = "# session.cfid #; HttpOnly = 'true' "; Cookie CFTOKEN = "# session.cftoken #; httpOnly = 'true'"; And this (which I think only works in CF10):
cookie.CFID = {value = "# session.cfid # ", HttpOnly =" true "}; Cookie CFTOKEN = {value = "# session.cftoken #", httpOnly = "true"}; then (this is not an error but did not work):
cookie (name = "CFID" value = "# session.cfid #" HttpOnly = "true"); Cookie (name = "CFToken" value = "# session cftoken #" httpOnly = "true"); When I run these, I reload an empty cache hard in Chrome when the page is reloaded, then I should see the resource cookies HTTP Only column show check box.
I might have been tired and the top combo could be hit right and I was also positive on failure because of the positive side jump around. Occasionally I get the best of cached things.
I have a CFL container style that works, but my application.cfc is all script style and I want to keep it like this ... so how do I do it
Updates to my fix: I used getPageContex () below, but it was not working as it was. Also the session threader () event handler has been changed to create a session. CFID and session. CreateUUID () with CTOKN which is also new in my app.cfc file. Therefore, here's a block of code for future generations. Start the session on
function () {getPageContext (). GetResponse () AddHeader ("set-cookie", "cfid = # session.cfid #; path = /; HTTPOnly"); GetPageContext (). GetResponse () AddHeader ("Set-cookie", "CFTOKEN = # session. CFTOKEN #; path = /; HTTPOnly"); } Another note: If the session is cleared for some reason and the onsetstart () handler is requested that cookie content set up above failed Will be done. There should be a catch or exception management of any kind added to the account for the reload problem. The best part is that Coldfusion 10 (or to issue CF 11 soon) has to be upgraded to appeal a compromise.
You can use the PageContext object to set cookies in ccscript:
GetPageContext (). GetResponse () AddHeader ("Set-cookie", "CIFID = # session. Cfid #; path = /; HTTP only;"); GetPageContext (). GetResponse () AddHeader ("Set-cookie", "CFTOKEN = # session. CFTOKEN #; path = /; HTTPOnly");
Comments
Post a Comment