DataTables has the option to save the state of a table (its paging position, ordering status, etc.) so that it can be restored when the user reloads a page, or returns to the page after visiting a subpage. This state-saving capability is enabled by the stateSave option.
The built-in state-saving method uses HTML5's localStorage and sessionStorage APIs for efficient data storage. Note that this means that the built-in state-saving option will not work with IE6 / 7 since these browsers do not support these APIs. Alternative options to use cookies or save the status on the server through Ajax can be used through the options stateSaveCallback and stateLoadCallback.
The duration for which the saved state is valid and can be used to restore the state of the table can be set using the stateDuration initialization parameter (2 hours by default). This parameter also controls whether localStorage (0 or greater) or sessionStorage (-1) is used to store the data.
The following example simply shows the state savings enabled in DataTables with the stateSave option.
$(document).ready(function() {
$('#example').DataTable( {
stateSave: true
} );
} );