Welcome Guest, Not a member yet? Register   Sign In
DX Auth logout Problem
#1

[eluser]RajeshChary[/eluser]
Hi friends

Iam new to PHP . I came across this wonderful framework CodeIgnitor. So eagerly started to develop application which made me ease with many features inbuilt without difficulty.

Iam stuck with some problem so please help me out here


Iam using DX Auth for authentiation everything working fine but when i click on logout the page displays with following error





A PHP Error was encountered

Severity: Notice

Message: Undefined index: key_id

Filename: libraries/DX_Auth.php

Line Number: 431
A PHP Error was encountered
Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\MyApp\system\libraries\Exceptions.php:166)

Filename: helpers/cookie_helper.php

Line Number: 92

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\MyApp\system\libraries\Exceptions.php:166)

Filename: libraries/Session.php

Line Number: 408
You have been logged out.



Thanks
Rajesh
#2

[eluser]smilie[/eluser]
Well, you got three messages there:
1st is a notice (which as it says, is only notice - could be critical, but also may not be critical).
That 1st one says that key_id is not defined. I do not know DX Auth module, so can't help you with that. But in any case, look for that 'key_id' in the code.

2nd and 3rd messages (warnings) are directly caused by first one. First (notice) printed some text on the screen and therefore 2nd and 3rd 'complained' that output already started :-)

Hope this helps a bit.

Cheers,
Smilie
#3

[eluser]RajeshChary[/eluser]
Hi smilie thanks for your reply
-----

What you have pointed out is true..errors are caused because of the first (Notice)error.

Key_id is in the DX_Auth.php

// Delete db entry
$this->ci->user_autologin->delete_key($auto['key_id'], $auto['user_id']);
what iam thinking from the above line is used to delete the auto login entry from the database table user_autologin.

I got the error resolved by rewriting the code as

// Delete db entry
if(isset($auto['key_id'])){
$this->ci->user_autologin->delete_key($auto['key_id'], $auto['user_id']);
}

But what actually strikes to me is i think while any user logs in , I think one entry is inserted with key_id in the table user_autologin.
Please correct me if am wrong ??

Thanks
Rajesh
#4

[eluser]smilie[/eluser]
Hi,

I am not sure about the database. Take a look at login script and check where does key_id get's defined (in $auto). That may clarify some things :-)

Cheers,
Smilie




Theme © iAndrew 2016 - Forum software by © MyBB