You can't store a database connection in the session.
Moreover, connecting to the database on every page will NOT make your site very slow. Connecting to the database is a fast operation and only needs to be done once per page, no more times.
Normally the techique is to create one connection initially for each page, then reuse the connection during page generation. Typically this is done by putting the connection in a global variable which you set up in some file which is require()'d at the top of each page.
Mark