New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove request related variables that can be retrieved otherwise if needed. #557

AdamNaj opened this Issue Dec 31, 2015 · 1 comment


None yet
2 participants

AdamNaj commented Dec 31, 2015

Following variables are no longer added to session:

  • $HttpContext - previously initialized as: HttpContext.Current
  • $request - previously initialized as: HttpContext.Current.Request
  • $response - previously initialized as: HttpContext.Current.Response
  • $ClientData - previously initialized as: Sitecore.Context.ClientData
  • $ClientPage - previously initialized as: Sitecore.Context.ClientPage

Those variables being initialized automatically caused increased risk of memory leaks. In sessions that are request specific scripts can still create those variables such as:

$HttpContext = [System.Web.HttpContext]::Current;
$request = [System.Web.HttpContext]::Current.Request;
$response = [System.Web.HttpContext]::Current.Response;
$ClientData = [Sitecore.Context]::ClientData;
$ClientPage = [Sitecore.Context]::ClientPage;

Scripts using those automatic variables need to be fixed as part of this task.

@AdamNaj AdamNaj self-assigned this Dec 31, 2015

@AdamNaj AdamNaj added this to the 4.0 milestone Dec 31, 2015

AdamNaj added a commit that referenced this issue Dec 31, 2015


This comment has been minimized.


AdamNaj commented Dec 31, 2015


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment