You are about to send an email using the outgoing email api. At this time, access_token only needs to be acquired once, so I want to run the authentication process once and share it in several sessions without renewing the key until the key expires. Usually, if you save it to a database or to a file, you will be able to access it anywhere within php of the Apache web server. However, I would like to ask you how about saving it in a better place than saving it in this database or file. For example, isn't it a good idea to store it in php's super global variable?
if($_GLOABLS['token'] != null)
$_GLOABLS['token'] = access_token;