在一个页面中跳转使用Redirect跳转,要想获取跳转前的cookie,请修改为Transfer方法。
如:
string url = TemplateSourceDirectory + "/Default.aspx?userGroupID=" + userGroupID + "&endUrl=" + endurl;
Response.Redirect(url);
修改为:
Server.Transfer(url);
在跳转成功后,这样就能获取跳转前的cookie或session的值。