idunno.CookieSharing
idunno.CookieSharing copied to clipboard
Cookie sharing fails if cookie has several chunks.
Hi. I'm seeing an issue where ticket sharing won't work if the cookie content is long and has several chunks.
Steps to reproduce:
Get latest for idunno.CookieSharing. In idunno.CookieSharing.Core, HomeController.cs, add a (very) long claim to the ClaimsIdentity so the cookie is chunked.
Run both .Net Core and .Net 4.5 websites.
.Net 4.5 site sees the cookie, but the user is not logged in.
At the bottom of the page there is still the "Create a login cookie" option.
Any ideas on how to fix this?
Update: I got it working by coping the code from https://github.com/jchannon/katanaproject/blob/master/src/Microsoft.Owin/Infrastructure/ChunkingCookieManager.cs and then replacing "chunks:" with "chunks-" and assigning this custom CookieManager at UseCookieAuthentication in the .Net 4.5 project.
I think this should be backwards compatible out of the box. I there something I'm missing?
Hmm strange. @Tratcher @HaoK did the chunking format change in cookies?
Yes, katana was using a character in the first line that wasn't supposed to be used in cookies. : I think.
There's a new CookieChunkingManager in the interop package you can plug into Katana handle this. https://github.com/aspnet/Security/blob/dev/src/Microsoft.Owin.Security.Interop/ChunkingCookieManager.cs
Thanks @Tratcher. I'll give it a try