You could always just send them to a login error page.

Otherwise, the only ways to transfer information between different php pages that I know of are POST, GET, cookies, and write it to a db/file.

You don't want cookies, writing it to a file/db is not needed, so looks like either post or get.