Welcome Guest, Not a member yet? Register   Sign In
Problem with login script using codeigniter's session library
#1

[eluser]Tomas Sundvall[/eluser]
Hello!

I have created a login-script using codeigniters session library, and it works nice. The problem is that some user's who use Internet Explorer are automaticly logged out to and fro.

Sometimes it works pretty good with IE, and sometimes they are logged out as soon as they click on a link.

I just can't see why it works perfectly for all user's except those who use IE. Does anyone know what the problem is, and why?

/Tomas
#2

[eluser]Slowcheetah[/eluser]
Maybe give some code?

Did you set sess_match_useragent TRUE?
#3

[eluser]Tomas Sundvall[/eluser]
Yes, the sess_match_useragent is set as TRUE, do you think I should set it to FALSE?

The code is very simple, if the password and username is correct, the login session is set to true, and then I check in if the login session is true or not in the constructor of my controllers. Just as I do when I create login scripts with regular sessions.

This means that I don't think that the code is the problem, it's more likley that I have to change some settings or something like that. I mean it work's perfectly in all browsers except IE. I also think that's strange since the sessions shouldn't have anything to do with the browser?

Is there anyone here who have experienced the same problem or maby just have written a login-script using CIConfused session library?

/Tomas
#4

[eluser]Slowcheetah[/eluser]
No, i don't think the sess_match_useragent should be set to FALSE..

As far as i know there are no bugs/errors with the session lib regarding to specific browsers.

Apart from that i don't think you should store a login session with TRUE or FALSE. You know a client can change the session manually and set it TRUE without even logging in. I personaly store the username and password in a session, and check the credentials each time if a secured page is visited, although i don't know if this is the best way to do this.
#5

[eluser]JoostV[/eluser]
If IE refuses to set sessions there is a good chance is that your server clock is not set to the correct time. Did you check it?
#6

[eluser]Tomas Sundvall[/eluser]
Slowcheetah: I don't use TRUE or FALSE, I have a random string to check if the user is logged in, I just thought it would be easier to understand if I said TRUE and FALSE Smile.

JoostV: The website is hosted on one of the major webb hotels in Sweden so I don't think that's the problem. But maby I should check it up anyway.
#7

[eluser]Jan van Casteren[/eluser]
I found out this week that CI session don't work on IE7 when your own computerclock (so the clock of the user of visits the website) is not set correctly.
#8

[eluser]Tomas Sundvall[/eluser]
Ahh I see, that explains the problem! Do you know if there is any way to get around this bug? I mean if there isn't, CIConfused session library is pretty useless. I mean if you can't rely on that it will work for IE7 users.




Theme © iAndrew 2016 - Forum software by © MyBB