SET a variable in mysql only once

Viewed 1207

I am using classic ASP and MySQL (using PHP wouldn't change the point of the question).

I need to set a variable over my homepage:

SET block_encryption_mode = 'aes-256-cbc'

I can not set it as global variable as other users are using the server and may use the default block_encryption_mode.

I know I can use the statement using ASP/PHP on the beginning of each webpage, but that seems like using too much resources; every user will execute the SET statement on every page...

Is there a way to SET variable or execute some other SQL statement at the beggining on each session, like an onstart event like ASP has, maybe? Or how could I achieve my goal without executing the query for each user on every page I have?

2 Answers
Related