Home > widget-integration > FilterStorageHelper > setPaginationSession

FilterStorageHelper.setPaginationSession() method

Sets the pagination page in session storage.

Stores the current page number in session storage for persistence across page reloads during the same browsing session. Validates and normalizes page numbers.

Signature:

setPaginationSession(page: number | string): void;

Parameters

Parameter

Type

Description

page

number | string

The page number to store (number or string)

Returns:

void

Remarks

Page numbers are validated and default to 1 if invalid (NaN, 0, negative). Uses session storage so pagination state clears on new browser sessions.

Example

Override to add page tracking:

setPaginationSession(page) {
  super.setPaginationSession(page);
  // Track pagination for analytics
  this.analytics.track('pagination_changed', {
    page: Number(page),
    timestamp: Date.now()
  });
}