I met one more problem with CSRF protection. All works fine, but when I'm trying to post ANY CSRF-protected form from FIRST PAGE is always fails. I'm using pagnation:
public function indexAction($boardAbbr, $currentPage = 1)
{
........
// Passing a resultset as data
$paginator = new Paginator(array(
'data' => Threads::find(array(
'board_id = ?0',
'bind' => array($board->id),
'order' => 'modified_at DESC'
)),
'limit' => $this->config->hakaba->threadsPerPage,
'page' => $currentPage
));
...
$this->view->page = $paginator->getPaginate();
$this->view->token = $this->security->getToken();
$this->view->tokenKey = $this->security->getTokenKey();
view:
{% for thread in page.items %}
{{ partial('partials/thread') }}
{% endfor %}
Notice, that the error appears on first page only. No matter is URL : https://localhost/nature or https://localhost/nature/page/1 in any case I got changed tokens But when I trying to post the form on https://localhost/nature/page/2 it's posted successfully. Any ideas?