Cider Carbonation

I have made my first batch of hard cider and for bottling and carbonation I have used corn sugar (36 g/Gal)
The carbonation was great after a few weeks but the cider lost almost all it carbonation after 5 month.
Is there a shelf life or am I doing something wrong?
Any tips for cider carbonation?

Welcome to forum.

It seems like your bottle caps must have been leaking.  This is not normal.  You might need to try different caps or a different capper to ensure a good seal.  My ciders remain carbonated for several years with no change or loss of carbonation.

Agreed. I had a crappy wing capper once that wouldn’t make a good seal. If you looked carefully at the caps you could see that it wasn’t crimped all the way around. A good crown cap will hold carbonation for years, possibly decades.