I've been wondering about the security aspect of my application. I'm using CodeIgniter PHP Framework for my project.
I'd like to know some "expert" opinions on this. I have a login function. When a user logged in, the session is store in database. I added information like user Id in the information session. A user can create a company. But to do that, I first check his account to see if he already has one. This session user Id allows me to run a DB request to find that out. For example :
function create(){
$hasCompany = $this->Accountmodel->hasCompany($this->session->userdata('id'));
if($hasCompany){
$data['company'] = $this->Companymodel->getCompanyInfo($this->session->userdata('id');
$this->load->view('company/panel', $data);
}
else{
$this->load->view('company/create');
}
}
And then if he has one, I can print the company edit/delete panel. It allows me to avoid the use of id parameters in the url like : myserver.com/company/edit/[id]
So to get to the point, I was wondering if, in term of security, this is ok or there is some kind of vulnerability.
Any advices are welcome !