How to prepend a Views query with another query?
Why do you think you need to alter the query itself? You literally said you needed to set a …session value.

You can issue any query prior to the views query on that page load to achieve the desired affect. Eg db_query('set mysql_max_group_concat=5;');

If you want to so it in the views lifecycle you could use any hook_views_* api call which states it runs prior to query execution. Look at the views api docs.

Or you could likely use hook_page_build  for all its worth. Or hook_init ... whatever suits your needs.