Is there a way to save shared $variables in memory so I don't have make this variable for each script execution,
Btw, I wont to save in the session...
Well you put this question in the "Cache" category, so you're on the right track. The docs have a section about caching: https://docs.phalcon.io/en/latest/reference/cache.html