Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display connection specific cookies in Erlang

Tags:

erlang

When setting a cookie on a node with erlang:set_cookie/2 it is possible to set different cookies for different nodes. Is there any way to display, which cookie is set for which node?

Calling erlang:get_cookie/1 does not display this information, only the "default" cookie is displayed.

Example:

Start NodeA with cookie foo and a NodeB with cookie bar. At NodeA now set the cookie to use when communicating with NodeB to bar by calling erlang:set_cookie(NodeB, bar). Pinging now works fine, no "Connection attempt from disallowed node..." errors. Calling erlang:get_cookie() on NodeA however still shows the "default" cookie foo. How can find which cookie is set for NodeB?

like image 944
jvf Avatar asked Dec 02 '25 15:12

jvf


1 Answers

It doesn't seem to be documented, but auth:get_cookie/1 does what you want. For your case, you can call auth:get_cookie(NodeB) on NodeA.

like image 171
Steve Vinoski Avatar answered Dec 05 '25 03:12

Steve Vinoski



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!