Save "Rows per Page" to cookie

Hi,

is there any solution to save the current selected “Rows per page” to a cookie to remember the users choice?

regards

kai

I found a solution by myself.

grid.attachEvent("onPaging", function (count){
   setCookie('rowsBufferOutSize', grid.rowsBufferOutSize, 60);
});

.....

var rowsBufferOutSize = getCookie('rowsBufferOutSize');
if(rowsBufferOutSize == ''){
	rowsBufferOutSize = 50;
}
grid.enablePaging(true, rowsBufferOutSize, 3, "pagingArea");

function setCookie(cname, cvalue, exdays){
	var d = new Date();
	d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
	var expires = "expires=" + d.toUTCString();
	document.cookie = cname + "=" + cvalue + "; " + expires;
}

function getCookie(cname){
	var name = cname + "=";
	var ca = document.cookie.split(';');
	for (var i = 0; i < ca.length; i++) {
		var c = ca[i];
		while (c.charAt(0) == ' ')
			c = c.substring(1);
		if (c.indexOf(name) == 0)
			return c.substring(name.length, c.length);
	}
	return "";
}