// SetSession stores the given value under the given name in the database.
// If the given name is already used, its value is overwritten.
SetSession stores the given value under the given name in the database.
If the given name is already used, its value is overwritten.
// SetSession stores the given value under the given name in the database . // If the given name is already used its value is overwritten .
func SetSession(name string, value SessionInfo) {
	result := RedisClient.HMSet("session:"+name, map[string]string{
		"userId": strconv.Itoa(value.UserID),
	})
	if result.Err() != nil {
		log.Println("Error while setting session: ")
		log.Println(result.Err())
		return
	}
	expireResult := RedisClient.Expire("session:"+name, 7*24*time.Hour)
	if expireResult.Err() != nil {
		log.Println("Error while setting session: ")
		log.Println(expireResult.Err())
		return
	}
}
func SetSession ( name string , value SessionInfo ) { result := RedisClient . HMSet ( " " + name , map [ string ] string { " " : strconv . Itoa ( value . UserID ) , } ) if result . Err ( ) != nil { log . Println ( " " ) log . Println ( result . Err ( ) ) return } expireResult := RedisClient . Expire ( " " + name , 7 * 24 * time . Hour ) if expireResult . Err ( ) != nil { log . Println ( " " ) log . Println ( expireResult . Err ( ) ) return } }
SetSession stores the given value under the given name in the database.
SetSession stores the given value under the given name in the database .