Welcome Guest, Not a member yet? Register   Sign In
DX Auth bug or misunderstanding of sessions/flashdata?
#1

[eluser]MarcL[/eluser]
I've been using the great DX Auth library to my user authentication and it's working really well. I'm using the auth controller as per the example code but I've either found a bug or I need a clarification of how sessions and flashdata work.

I've altered the auth controller to set some flashdata for 'You have logged in' and 'You have logged out' messages which are displayed by the main view. However, if I set the flashdata from the logout method of the auth controller it doesn't display.

Now the auth controller calls the DX Auth logout method which in turn calls:

Code:
$this->ci->session->sess_destroy()

and this causes the flashdata problem. Removing this line fixes the problem.

So my question is whether DX Auth should destroy the session at this point? I tried altering it so it just unsets all of the 'DX_...' data and this seems to work fine.

I might be misunderstanding how sessions work (as I'm a web app newbie!) but shouldn't the session remain as it might contain other data not related to DX auth?

Thanks,
Marc
#2

[eluser]davidbehler[/eluser]
Yeah, that's something done quite often and I have to admit I did the same in my auth library until someone pointed out how much trouble destroying the session can cause. I think in the thread concerning the new cart library the same issue came up.

Therefor I would say this is a bug and should be fixed/changed.
#3

[eluser]MarcL[/eluser]
Thanks for the info Waldmeister!




Theme © iAndrew 2016 - Forum software by © MyBB