What will happen to asp.net membership if the client browser is not accepting cookies
This thing has just came to my head and I wanna share it.
开发者_如何学GoNote : I could easily test it but I am being lazy here to see if anybody has ever experienced something like that before.
Let's assume that I have a web site which built-in membership structure of asp.net has been implemented on.
What will happen to asp.net membership if the client browser blocks cookies? Does framework throw an exception when a user tries to log in or do something else?
It's not a problem. Check ASP.NET cookieless sessions.
For cookieless browsers asp.net provides session id to embed in URL;
http://msdn.microsoft.com/en-us/library/aa479314.aspx
Very simple test; just change in web.config
<sessionState cookieless="true" />
To answer your question, I don't think any exceptions will be raised, but if the client does not accept cookies (blocking them etc), then I think they will just keep being redirected to the login page because no authenticated cookies would be sent with any request...e.g. every request would appear unauthenticated...if the resource didn't require authentication, things would be normal...
Edit
If you want cookieless forms authentication, this MSDN article explains how...you would basically add:
<forms cookieless="UseUri" />
although, you might be able to try AutoDetect and it will use cookies where possible
<forms cookieless="AutoDetect" />
精彩评论