I try to implement XSRF on gwt project, but get error:
[WARN] Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract com.google.gwt.user.client.rpc.XsrfToken
com.google.gwt.user.client.rpc.XsrfTokenService.getNewXsrfToken()'
threw an unexpected exception:
com.google.gwt.user.client.rpc.RpcTokenException: Invalid RPC token
(Session cookie is not set or empty! Unable to generate XSRF cookie)
at
com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:
385)
[ERROR] 500 - POST /gorod/xsrf (127.0.0.1) 57 bytes
Request headers
Host:
127.0.0.1:8888
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/
20100101 Firefox/4.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cache-Control: no-cache
Referer:
http://127.0.0.1:8888/Gorod.html?gwt.codesvr=127.0.0.1:9997
X-GWT-Permutation: HostedMode
X-GWT-Module-Base:
http://127.0.0.1:8888/gorod/
Content-Type: text/x-gwt-rpc; charset=utf-8
Content-Length: 142
Pragma: no-cache
Response headers
Content-Type: text/plain
I have gwt-dev.jar on my WEB-INF/lib and classpath.