Welcome Guest, Not a member yet? Register   Sign In
Sessions + logging in from only one location
#6

[eluser]intractve[/eluser]
[quote author="elverion" date="1297410689"]
I wasn't saying it was a bad idea, only that it was sort of hackish and works around the issue rather than addressing it directly. I would still prefer a simple way of deleting sessions where a specific user_data matches some value (ie. userid) that doesn't require looping through all sessions in the database.[/quote]

I am not touching any of the core code, not extending a class or library, so how is it hack-ish? Plus there is no issue, CodeIgniter does not have an auth library, so by your definition everything is hacked on right now.

There is no simple way around it. There will be loops, there will be database calls in any method you choose to use whether this one or some other. FYI there is no loop in my method. It's a single SQL call to delete entries that have no corresponding entries in the user table.

You will not face performance issues with the method I used because it's being called only on login and no other time. You may need a different method if you are going to checking this on every action the user makes. Then you'll have to worry about performance.


Messages In This Thread
Sessions + logging in from only one location - by El Forum - 02-10-2011, 01:57 PM
Sessions + logging in from only one location - by El Forum - 02-10-2011, 02:57 PM
Sessions + logging in from only one location - by El Forum - 02-10-2011, 06:06 PM
Sessions + logging in from only one location - by El Forum - 02-10-2011, 07:16 PM
Sessions + logging in from only one location - by El Forum - 02-10-2011, 07:51 PM
Sessions + logging in from only one location - by El Forum - 02-10-2011, 08:00 PM
Sessions + logging in from only one location - by El Forum - 02-10-2011, 09:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB