Welcome Guest, Not a member yet? Register   Sign In
storing db info in session
#1

[eluser]brian88[/eluser]
is storing database info in the session a good idea?

Code:
$data = array(
    'logged_in' => true,
    'userInfo' => $this->login_mod->getUserByEmail( $this->input->post('email') )
);
$this->session->set_userdata($data);

Now I have all the users info but inside the session, which I think is too long of code
Code:
<?php echo $this->session->userdata('userInfo')->name; ?>

Is this good practice? Is there any downsides to this or can the session somehow break?
Also, is it bad to store a sha1() password in it too?


Messages In This Thread
storing db info in session - by El Forum - 04-17-2012, 11:25 AM
storing db info in session - by El Forum - 04-18-2012, 01:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB