Posts

Showing posts with the label session

Sessions and session_create_id() with Prefix and strict mode config set to on

Sessions and session_create_id() with Prefix and strict mode config set to on My objective is to create a more secure session id.I am attempting to prefix a sha1 hash on to the existing Session, Though my concern now is that in order to do this I have to shut strict mode off is there a way to do this while keeping strict mode on? function sess_regenration(){ if (session_status() == PHP_SESSION_NONE){ //CreateRandomStringForPrefix $RandomizerForPreFix = str_split("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); shuffle($RandomizerForPreFix); $EmptyStringToAppenRandomizer = ''; foreach($RandomizerForPreFix as $Element ){ $EmptyStringToAppenRandomizer .= $Element; } //HashShuffle $HashedValue = sha1($Element); //CreateNewSessionIdWithPrefix ini_set('session.use_strict_mode',0); $CreatedId = session_create_id($HashedValue); session_id($CreatedI...