Welcome Guest, Not a member yet? Register   Sign In
front and back offcie
#1

[eluser]aktosci[/eluser]
I am doing a back office application. That means that user have to login.

How do you do that ? do you have exemple ? Is the authentification system included in this framework of do I have to write it from scratch?

Thanks.
#2

[eluser]louis w[/eluser]
There are authentication libs which have already been developed for CI. Did you try searching the forums?
#3

[eluser]aktosci[/eluser]
I created my own auth solution but as I use session it does not work

echo "session".$_SESSION['user'];
I got
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: _SESSION

It does not work in controler but in a view only.
#4

[eluser]louis w[/eluser]
Check out the Session Library.

Code Igniter clears out the SESSION variable (and GET/POST) for security reasons. This is their built in library for interacting with the session. Offers some nice things like encryption, etc.
#5

[eluser]Dam1an[/eluser]
If you insist on using PHP essions over CI ones, you need to remember to start the session (using session_start())
#6

[eluser]aktosci[/eluser]
Thanks you I could do what I wanted !

On my view I change my Session php to session ci

$this->session->set_userdata('ut', $_SESSION['us']);

and then I can user on my model

$this->session->userdata('ut');
#7

[eluser]dsloan[/eluser]
Have a look at http://codeigniter.com/wiki/Category:Con...entication




Theme © iAndrew 2016 - Forum software by © MyBB