http://www.mojavelinux.com/wiki/doku.php?id=notebook:xstartup
One of the most misunderstood workflows is the scripts that lead up to the start of the window manager. At least, I have always found myself at a loss of what actually takes place. This page details some of my findings when working with the Fedora and Debian distributions. In then end, I should hope that you know where to stick that environment variable setting so that it evaluates on X login (window manager environment).
Xsession runs through the /etc/X11/Xsession.d/ directory and executes the scripts in numeric order (allows the control of execution order)
Note: Fedora calls the exec command with the login flag (-l), which triggers the shell profile scripts to execute. Debian, on the other hand, uses a raw exec call, so it is necessary to create a $HOME/.xsession script in order to execute the shell login scripts, such as ~/.bash_profile