1
Vote

Allow cookies - remember settings over redirect

description

Hi,
 
first some little background information (really just basic). We set a cookie value during Page_Load event and afterwards make a redirect to the same URL so that all other web parts catch up with this new value. Now as long as SPWakeUp doesn't "understand" cookies it will redirect "forever" because the cookie value will always be empty.
 
And after 50 redirects (=default value) the following exception will be thrown: "Too many automatic redirections were attempted".
 
Therefore could the following code be added to allow sites with cookies and redirects to be warmed up too.
 
I have tested it and by adding the following code inside "GetWebPage" the problem is solved:
 
CookieContainer cookieContainer = new CookieContainer();
request.CookieContainer = cookieContainer;
 
Comment: WebRequest doesn't have a property "CookieContainer" but HttpWebRequest has.
 
Please feel free to comment and I would be more than happy to discuss this further.
 
Thanks a lot!
 
Best regards,
Johann

comments