There is a difference between "communion medals", such as this piece, and "communion tokens" such as those in the book mentioned by Circus.
Communion medals were and still are given, particularly in the Catholic and High Church Anglican/Episcopalian traditions, when a child/young adult partakes in their First Communion ceremony. As far as I am aware they serve no particular purpose or function within the church, other than as a reminder to that young person of their new status as a Communicant.
Communion tokens, in the Presbyterian sense of the word, served a very different purpose. These churches traditionally observe "closed communion" - only certified members of the church may partake. In order to ensure no trespassers intruded upon the communion service (which happens two or three times a year), the practise arose back in the 1600s of distributing communion tokens prior to the service. The distribution was done by the minister, who might ask questions regarding the member's spiritual state before deeming them worthy or not of taking part. Anybody turning up without a token would be refused entry.
Early communion tokens were pretty crude: usually just a small piece of lead, stamped with the initials of the minister or the church. Later tokens from the 1800s were more elaborate, often with pictures of the church, the communion table and the relevant Bible verses.
Communion tokens are known not just from Scotland where they originated, but everywhere the Scottish church spread to - including Canada, America, Australia and New Zealand.
Don't say "infinitely" when you mean "very"; otherwise, you'll have no word left when you want to talk about something really infinite. - C. S. Lewis