While setting the variables in etc/X11/Xsession.d/40x11-common_xsessionrc does work it is generally better to leave the Ubuntu maintained files alone and set the variables in .xprofile and/or /etc/xprofile instead. If you edit a Ubuntu packaged file the file won't be automatically upgraded by the system. This could be an issue if there is a bug in the orginal file. Although in this case there is so little 40x11-common_xsessionrc that it is likely not an issue.
While setting the variables in etc/X11/ Xsession. d/40x11- common_ xsessionrc does work it is generally better to leave the Ubuntu maintained files alone and set the variables in .xprofile and/or /etc/xprofile instead. If you edit a Ubuntu packaged file the file won't be automatically upgraded by the system. This could be an issue if there is a bug in the orginal file. Although in this case there is so little 40x11-common_ xsessionrc that it is likely not an issue.