As per official documentation, ~/.pam_environment is for session-wide environment variables which will affect just a particular user. It means that when you edit that file as yourself or as root you edit two different files.
If you do this as your user:
user@here:~$ sudo nano ~/.pam_environment
it will open /home/user/.pam_environment.
But if you if open it as root
user@here:~$ sudo su
root@here:~$ nano ~/.pam_environment
it will open /root/.pam_environment.
So you have to be carefull not to edit this file as root.
To check that your environment variables do exist, edit ~/.pam_environment save it and logout or exit ssh session. When you login again run export which prints out all variables
user@here:~$ export