Welcome Guest, Not a member yet? Register   Sign In
About sessions, cookies and security
#1

[eluser]Unknown[/eluser]
Hello,

I know that there are a lot of questions about ci session class but i would be glad if anyone though answers my questions.

So i tried using sessions when a user is logged in. Then the session data is stored in a database and cookie. I understand what sessions are but i think i miss something. After I have created the session I used print_r in order to see what is really going on:

Code:
$this->session->set_userdata('usern', 'azsaassbc');
            echo 'Session created';
            print_r($this->session->all_userdata());
            echo '<br>';$this->load->helper('cookie');
            print_r($this->input->cookie('ci_session'));

The output is quite similar. But i dont really understand this part of the cookie:

Code:
a:4:{.......:"last_activity";i:1390910452;}ec57ffd9734a188acea2ae03f6b425a3

I dont know what this hash at the end is. And is there something else i should do... I mean to prevent the user changing somehow the session id and getting access to the account of someone else?

...another question. The expiration time of cookies is quite longer than of the session. Why is this so? What's the purpose of this?

Thanks in advance!




Theme © iAndrew 2016 - Forum software by © MyBB