Wiring a porch light fixture

Yesterday I had a helluva time feeding the wires through an old porch light fixture. I was finally able to do it, but the wires I used were only 18 gauge (from an IKEA light fixture I wasn’t using). I am only going to use CFL bulbs in this fixture [at night]. Is the 18 gauge safe or do I need to use 14 gauge?

I’m lost.
Were the wires in the fixture 18 ga and you attached them to the 14 ga house wires? Or did you run new 18 ga wires from the switch to the fixture?
Anyway look at the fixture, it will have a max wattage rating on it. As long as you do not exceed that max, you should be fine.
I will guess with 18 ga wires the rated max is probably 60 watts. CFLs produce the light of a 60 or 75 watt bulb but use much less electricity about 11 watts IIRC. So in this case yes it would be safe.
What is not safe is taking out that 11 watt CFL and replacing it with a 200 watt incandescent.

In the fixture, I wired a new porcelain keyless socket with new 18 gauge stranded wire and connected it to the old cloth wires (probably 12 gauge) inside the wall.

Ah, you rebuilt the fixture. Sounds like you’re good to go - most light fixtures only have #18 wires to connect to the house wiring, which would be either #14 or #12.