CodeIgniter Forums
simplelogin class, cookies, sessions, --- problems logging in - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: simplelogin class, cookies, sessions, --- problems logging in (/thread-20891.html)

Pages: 1 2


simplelogin class, cookies, sessions, --- problems logging in - El Forum - 07-24-2009

[eluser]deco10[/eluser]
Hi
I'm lost here and a bit frazzled.
I don't have access to these reports, I'm just told that there are quite a few people who are having difficulty logging into the site. I suspect their browser security is too high, but I don't think I have any way of knowing.

When they login using the wrong credentials I have it set to come back and notify them, as you would expect. When these people try to log in, nothing happens. They just get redirected back to the login page as it was before before they entered their info and clicked "login". Now I don't expect anybody to have a direct answer for me, but can you suggest how I should approach this?


The way this site was previously there was never a problem with browser security, but it used the passwd file and a box that automatically popped up when files from the "members" folder were accessed.

I appreciate any suggestions you may have in this dark hour Smile

Thanks!


simplelogin class, cookies, sessions, --- problems logging in - El Forum - 07-24-2009

[eluser]Nicholas Bello[/eluser]
The first thing i guess to figure out is why they are getting kicked back to the login screen. Is it because the username and password is incorrect and they're just not seeing the message saying that. Or is it because they have valid login credentials but the session is not being set, hence when they try to access the member section the page is seeing the don't have a login cookie/session whatever and redirecting them back to the login page.

The other thing to try is get the members username and password and try it for yourself to see what happens.

Also, if you have access to the server logs maybe it would say something in there? Probably not but i've had a few 'aha' moments looking at the server logs.

Those are my thoughts. If you could post any code I would be able to give you a more educated answer.

Good luck!

-Nick


simplelogin class, cookies, sessions, --- problems logging in - El Forum - 07-24-2009

[eluser]deco10[/eluser]
It is possible that they aren't seeing the bright red text that says "invalid login/password....".

I have had one first hand account where a user couldn't log in, I just assumed it was because his browser security was set too high. Also, this is a site that people would be accessing from work, making it even more likely that the computer has more restrictions on it then would normally be expected.

Also, it is a common login. All users use the same one, at least for now.

Thank you for your input. Smile


simplelogin class, cookies, sessions, --- problems logging in - El Forum - 07-26-2009

[eluser]InsiteFX[/eluser]
try this when you send them back to the login page:


redirect($redirect, 'refresh');

enjoy
InsiteFX


simplelogin class, cookies, sessions, --- problems logging in - El Forum - 07-26-2009

[eluser]deco10[/eluser]
I'm on a linux server.
What is this achieving exactly? (I really don't know Smile )

Thanks Smile


simplelogin class, cookies, sessions, --- problems logging in - El Forum - 07-26-2009

[eluser]InsiteFX[/eluser]
It will refresh page cache when redirected back.
In a lot of the auth systems they had problems
were cache was retaining the last page they were
on.

Enjoy
InsiteFX


simplelogin class, cookies, sessions, --- problems logging in - El Forum - 07-26-2009

[eluser]deco10[/eluser]
This is a shot in the dark, but is there anyway I could recreate a scenario for the purposes of testing?


simplelogin class, cookies, sessions, --- problems logging in - El Forum - 07-26-2009

[eluser]deco10[/eluser]
also, is $refresh just the name of the function in the controller? (home/login) in my case


simplelogin class, cookies, sessions, --- problems logging in - El Forum - 07-26-2009

[eluser]deco10[/eluser]
Its not my intention to keep bumping my post but something just struck me as I lay in half-sleep.

Is it possible that when they submit the form that they're reloading the page from their browser cache? This is my basic code structure:


login_view.php (home/login):
Code:
<?= form_open('home/login', array("name" => "login") ?>
<= form_close() ?&gt;

home/login (controller)
Code:
$this->_login();  //uses simple login
if($this->session->userdata('logged_in')):
     redirect('home/members');
endif;

$data['title'] = "login page";
/*
process data, configure form etc


*/

     $this->load->view('login_view', $data);



simplelogin class, cookies, sessions, --- problems logging in - El Forum - 07-26-2009

[eluser]InsiteFX[/eluser]
Hi,

As I mentioned before, you need to refresh your page.

Code:
$this->_login();  //uses simple login
if($this->session->userdata('logged_in'))
{
     redirect('home/members', 'refresh');
}
else
{
     $data['title'] = "login page";
     /*
     process data, configure form etc
     */
     $this->load->view('login_view', $data);
}

you may have to add a refresh meta statement to your html view file as well.

see your redirect here.
hope this helps

enjoy
InsiteFX