Welcome Guest, Not a member yet? Register   Sign In
Authentication and Sessions
#9

[eluser]Peng Kong[/eluser]
[quote author="Michael Wales" date="1265405068"]
Wouldn't it be exponentially more secure to store the user ID and a hash of some of the user's data in the session? This simple change, regardless of the application's configuration, gives you the means to identify the user (the ID) and validate the session data hasn't been tampered with (the hashed data from their record).
[/quote]

Interesting~... and that's an good idea Michael.

I didn't really think about "regardless of the application's configuration" part since I thought it was obvious you shouldn't store the id IN a plaintext cookie (which user can edit) and use it straight away to consider the user authenticated! okay never mind you're right... bad assumption.

i mean hell~ i wont even store it with some encrypted hash... someone might figure out how you're hashing it and there goes security. and isn't that still vulnerable to spoofing and session fixation?! even though you can't edit the id because you can't guess the hash?

Wow but it looks like alot of other auth libraries also didn't consider the fact that a programmer might have his ci session setting not using db.

using db for ci session does have it's pro & cons but NOT in the case where you're using it for authenication imo. There's no option you have to use db. don't store anything in a cookie seriously just store it in the database. cookie is just there to say you own this session in db. there's no security w/o db.


Messages In This Thread
Authentication and Sessions - by El Forum - 02-04-2010, 10:14 PM
Authentication and Sessions - by El Forum - 02-04-2010, 10:27 PM
Authentication and Sessions - by El Forum - 02-05-2010, 01:58 AM
Authentication and Sessions - by El Forum - 02-05-2010, 02:05 AM
Authentication and Sessions - by El Forum - 02-05-2010, 06:53 AM
Authentication and Sessions - by El Forum - 02-05-2010, 08:31 AM
Authentication and Sessions - by El Forum - 02-05-2010, 09:24 AM
Authentication and Sessions - by El Forum - 02-05-2010, 09:38 AM
Authentication and Sessions - by El Forum - 02-05-2010, 09:52 AM
Authentication and Sessions - by El Forum - 02-05-2010, 10:10 AM
Authentication and Sessions - by El Forum - 02-05-2010, 10:16 AM
Authentication and Sessions - by El Forum - 02-05-2010, 10:18 AM
Authentication and Sessions - by El Forum - 02-05-2010, 10:25 AM
Authentication and Sessions - by El Forum - 02-05-2010, 11:00 AM
Authentication and Sessions - by El Forum - 02-05-2010, 11:15 AM
Authentication and Sessions - by El Forum - 02-05-2010, 02:00 PM
Authentication and Sessions - by El Forum - 02-05-2010, 04:56 PM
Authentication and Sessions - by El Forum - 02-05-2010, 10:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB