Archiving messes with sessions?

I made the observation that our Server hast plenty of sessionfiles that seems to be related to the arcivingscript you provide in you faq-section.
Every day at 5 am (the time we run the cronjob) 3 sessionfiles are generated (i assume for day week year) and not deleted. Could it be that the script opens a session and doesn’t close it correctly?

Session files are cleaned up by php periodically. See php.ini.

well… thanks… every other sessionfiles are deleted by the garbage collection, the ones generated by piwik are the only ones that doesn’t. That’s why I posted it here. Otherwise I’d call that a problem of our settings but because of this fact I’m not that sure about this.

Check your php.ini. php-cli may be using a different configuration file where garbage collection is disabled, has a lower probability of running, or has a longer lifetime.

Otherwise, this sounds like a php bug. A workaround would be to modify to use a custom session save path, and then delete those session files afterwards, e.g., (snippets below)

  CMD="$PHP_BIN -d session.save_path=$SAVE_PATH $PIWIK_PATH -- module=API&method=VisitsSummary.getVisits&idSite=all&period=$period&date=last52&format=xml&token_auth=$TOKEN_AUTH";
rm -f $SAVE_PATH/*