don't set session on every line, collect data to array and set session once at end.