cakephp primay key cant be used for user login
===

Im having a weird issue. My *employee* table has **id**->int(11) as primary key. It also has **code**->varchar(36), **password** and some other fields. This code and password are the two fields employees use to login to the system. I used cakePHP form helper to build the login page with Code field and Password field; and things were going fine. 

Today when i tried to update the employee table's another field using $this->Model->save, it inserted a new row instead of updating. Thats when i learnt that i need to set code as my primary key. So i put $primaryKey = 'code' in my Employee model.

The moment i put that, the Code field in my login page disappeared, leaving only Password field. When I removed the $primaryKey = 'code', the Code field came back.

So it has something to do with setting code as primary key in the Model. Is there any work around this?

I need to be able to update the Employee rows using **code** and retain my Code field in the login page.