Session variable in sql where clause

i want to ensure global variable does not get lost while user is logged in.
how to add session variable in grid where clause?
or do i compulsorily have to use global variable, right?
or can i use both session and global?
i want to use in where clause sql

WHERE
your_conditions
AND ( [your_global_var] = 1 OR 1 = 1 )