@@ -208,20 +208,19 @@ public void AppendResponseCookie(HttpContext context, string key, string? value,
208208 var dataSizePerCookie = ChunkSize . Value - templateLength - 3 ; // Budget 3 chars for the chunkid.
209209 var cookieChunkCount = ( int ) Math . Ceiling ( value . Length * 1.0 / dataSizePerCookie ) ;
210210
211- IDictionary < string , string > keyValuePairs = new Dictionary < string , string > ( cookieChunkCount )
211+ List < KeyValuePair < string , string > > keyValuePairs = new ( cookieChunkCount )
212212 {
213- [ key ] = ChunkCountPrefix + cookieChunkCount . ToString ( CultureInfo . InvariantCulture )
213+ KeyValuePair . Create ( key , ChunkCountPrefix + cookieChunkCount . ToString ( CultureInfo . InvariantCulture ) )
214214 } ;
215215
216-
217216 var offset = 0 ;
218217 for ( var chunkId = 1 ; chunkId <= cookieChunkCount ; chunkId ++ )
219218 {
220219 var remainingLength = value . Length - offset ;
221220 var length = Math . Min ( dataSizePerCookie , remainingLength ) ;
222221 var segment = value . Substring ( offset , length ) ;
223222 offset += length ;
224- keyValuePairs . Add ( key + ChunkKeySuffix + chunkId . ToString ( CultureInfo . InvariantCulture ) , segment ) ;
223+ keyValuePairs . Add ( KeyValuePair . Create ( string . Concat ( key , ChunkKeySuffix , chunkId . ToString ( CultureInfo . InvariantCulture ) ) , segment ) ) ;
225224 }
226225
227226 responseCookies . Append ( keyValuePairs , options ) ;
@@ -307,15 +306,14 @@ public void DeleteCookie(HttpContext context, string key, CookieOptions options)
307306
308307 var responseCookies = context . Response . Cookies ;
309308
310-
311- IDictionary < string , string > keyValuePairs = new Dictionary < string , string > ( chunks )
309+ List < KeyValuePair < string , string > > keyValuePairs = new ( chunks )
312310 {
313- [ key ] = string . Empty
311+ KeyValuePair . Create ( key , string . Empty )
314312 } ;
315313
316314 for ( var i = 1 ; i <= chunks ; i ++ )
317315 {
318- keyValuePairs . Add ( key + "C" + i . ToString ( CultureInfo . InvariantCulture ) , string . Empty ) ;
316+ keyValuePairs . Add ( KeyValuePair . Create ( string . Concat ( key , "C" , i . ToString ( CultureInfo . InvariantCulture ) ) , string . Empty ) ) ;
319317 }
320318
321319 responseCookies . Append ( keyValuePairs , new CookieOptions ( )
0 commit comments