When I connect an external monitor via VGA, the computer logs out (not just screen lock). I can see the lock screen on both the monitors with low screen resolutions on both. When I enter the password, the screens go blank, and it again comes back to lock screen. When I remove the VGA cable, the resolution is still low on my laptop. Then when I enter the password, I get back the lock screen again, this time with correct resolution. Now when I enter the password, I log in to the computer with all the previously running programs closed. I have also tried booting up while the VGA is already connected, but that too gives the same result. I was using this monitor with no problems on Ubuntu 14.04 previously on the same machine.
I am using OS 0.3.2 Freya (64-bit). I have a Nvidia GeForce GT 750M graphics card, but I am using the Nouveau driver. The monitor I am connecting is an LG Flatron with a resolution of 1440x900.