Session / Login help |
[eluser]gbd_dee[/eluser]
here is my logout controller Code: <?php
[eluser]gbd_dee[/eluser]
this is how im setting my custom session variables in my main controller Code: $this->session->set_userdata('username',$full_name);
[eluser]gbd_dee[/eluser]
sorry I have to put code in separate post or it flags it as spam bc im new to forum.... Now I want to create a controller called profile which basically gathers the users info from a model (which i have the model already and I know how to retrieve data) Profile controller and view needs to be restriced... how do I do this
[eluser]InsiteFX[/eluser]
I suggest that you take a look at one of the Auth systems in the IgnitedCode forum topic.
[eluser]Stefan Hueg[/eluser]
[quote author="InsiteFX" date="1335839899"] @stefan Hueg, And how do you figure I have missed directed him? If you do not unset the session userdata it will still exist, because there is no telling when the garbage collector will clear out the session! Look at your session table and tell me how many sessions you have left in it... [/quote] Look closely at the sess_destroy() function at the session class. It will delete the entry from your session table and reset the cookie. No need to manually unset the userdata. But not only that, his misconception was that he tried to do a redirect in a view if the user is not logged in. |
Welcome Guest, Not a member yet? Register Sign In |