I sometimes launch applications using different language environment variables, either because I prefer to use that application in a different language from my global defaults, or because I am trying to work around KDE/Qt's lack of support for custom date formats (see the much-hated Bug 340982). For example, I always launch Thunderbird with LC_TIME=en_DK so that it shows me YYYY-MM-DD dates in my message list. Unfortunately, ksmserver doesn't seem to remember the language environment for these applications when I save the session. (This problem occurs regardless whether the application was launched from a desktop shortcut or from a shell script that manually sets the environment variable(s).) For example, when I log out of KDE and log back in again, Thunderbird gets restored, but it formats the dates according to the system default locale rather than en_DK. It would be useful if ksmserver could somehow recognize when applications are launched with special environment variables, and re-set these variables when restoring the session. I realize that this may be difficult or impossible to do in the general case, but maybe it is possible at least for applications launched via a standard desktop/menu shortcut.
Ksmserver has no reasonable way to find out environment variables of applications. What is possible that applications tell ksmserver which variables to set again, so it would be up to each application to do this. But even than this is very problematic, as applications actually have no good way to known which variables should be restored - how is Thunderbind to know that your LC_TIME is special enough to be kept? If you launch apps in special ways manually, I'm afraid you'll need to do that manually too. I don't see a reasonable way to do this programatically, sorry.
You can exclude your application from ksmserver via system settings > startup and shutdown > desktop sessions. Later add your application via kmenuedit (right click Application Launcher > edit applications) with environment variable $ env ENV_VAR=true yourapplication --arg; And finally add the application to system settings > startup and shutdown > autostart > Add Program