I'm getting lens reflection when I take a long exposure and use a filter. I'm assuming it's because of the gap between the lens and filter so light gets in. See the images I've attached.
I'm wondering if there is a way I can stop this happening.
For starters you could put the filter in the closest slot, to close the gap a bit.
If it's still noticeable, I'd try some black electrical tape over the gap.
Remember to take it off again before you put it away for any length of time. It's the kind of tape that's easy on/off to start with, but gets horribly slimy if you forget it for 6 months.
Potentially it could simply be light coming through the filter, rather than from the edges, so you still may not eliminate it entirely.
If it is coming through the filter itself, you could experiment using each of the 3 slots on the filter holder & see which gives the least noticeable result.
...and xiota's idea of a lens hood could work if the light causing the interference is coming from out of frame. I've never tried putting a hood over a Cokin, but perhaps someone does a matte box that may fit in one of the slots??
Ouch - if you have the money - Cokin Matte Box, Model Z360 with an Integrated Z-Pro Filter Holder
I'd double-check that there is no accessory for your filter holder that blocks light. Mine has plastic gaskets that go over the filter holder that have plastic gaskets that seal up the space above the filter.
Here's the gasket halfway off:
And here's the gasket that covers the filter(s):
I also use a soft lens bag to cover the lens, which in your case, can be extended to cover the filter holder:
Light is reflecting off the back of the filter. You can plainly see the reflection of the front of the lens bouncing off the back of the filter.
Some type of makeshift hood that attaches to the front of the filter holder may solve the issue if the light were entering in front of and passing through the filter. But it's fairly obvious from your photo of the filter in the holder that the offending light is not coming through the filter, it's shining through the gaps behind the filter.
The first thing to do would be to place the single filter you are using in the rear slot of the holder. This will reduce almost all of the gap between the filter and the edges of the holder. You might still have some light leaking through around the edges of the filter, but it will be much less noticeable. There are ways to further reduce the amount of light leakage.
With square filter holders, sometimes light can leak in at the sides of the holder through the small gaps between the filter and the lens in the areas where the "springs" that hold the filters in place are cut out. Try using some sort of hood to shade the filter holder. This can be as simple as a towel or shade held between the filter holder/lens and the sun. If the hood alone does not solve the problem, try covering the side holes with some tape that leaves no residue, such as gaffer tape. If the top and bottom of your particular holder leaves gaps between the filter and the 'back wall' of the filter holder, as is obvious in your second photo, cover those as well.
This review of the Sensei 100mm filter holder discusses what causes light leaks and ways different manufacturers and users deal with them. This review of the Haida 150mm system has some closeups that show the foam gaskets some makers put on either the edges of the filter or the edges of the holder to help prevent light leaks.
You can even buy self adhesive 100mm foam gaskets to apply to bare filters yourself. Be warned, though, they may cause (additional) vignetting with very wide angle lenses as they do slightly crop the edges of the filter to which they are attached.
Although it is not the cause of your reflection, Lee also recommends the viewfinder be covered when using their filters for long exposures. Light can leak around the raised mirror and get into the light box of many cameras, particularly if the camera is well used and the seals around the mirror assembly are worn.
This article by Paul Reiffer delves into the issue of light leaks with filter holders and shows example photos. It also include a comparison of three 150mm systems for his wide angle lens with built-in hood. The winner may surprise you.
Black cloth draped around the lens and filters.