function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
hramanihramani 

Connection between a remote action method and Require HttpOnly attribute in session settings.

I get the below error while loading a VF page. VF page’s extension is ‘ApplicationReaderController’ which contains a remote action named ‘getMergedPdfUrlWithCookie’.

{"statusCode":400,"type":"exception","ref":false,"action":"Unknown","method":"Unknown","message":"Method 'getMergedPdfUrlWithCookie' not found on controller TargetX_Reader.ApplicationReaderController. Check spelling, method exists, and/or method is RemoteAction annotated.","where":"","data":"","vfTx":true,"vfDbg":true,"tid":6,"result":null,"status":false}

Initially when I loaded the page, I didn’t get this error but when I set the ‘Require HttpOnly attribute’ to true, I got the error. Now I set the Require HttpOnly attribute value to false and then load the page again and I get the error. I refresh the page number of times, I still get that error. I also tried switching that setting (Require HttpOnly attribute) back and forth and I constantly get that error.

Can someone help me with the reason and the solution please.


 
Khan AnasKhan Anas (Salesforce Developers) 
Hi,

Greetings to you!

It looks like you aren't passing the right number of parameters to the controller class and also make sure parameter types are exactly matched.

Please refer to the below links which might help you further with the above issue.

https://developer.salesforce.com/forums/?id=906F000000097OUIAY

https://salesforce.stackexchange.com/questions/220882/can-i-declare-more-than-one-remoteaction-function-in-my-class

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
hramanihramani
Hi Khan,

Thanks for the reply.
But I'm just wondering why it is happening intermittently with this attribute switched between true and false, if the parameters are incorrect, may be it should be failing all the time. Please advise.

Regards,
Hari