Cannot create journal

I have installed the ojs, and successful to login in.
When i was ready to create a journal, i filled data in the form and submitted.
The error showed up that was “{“error”:“form.csrfInvalid”,“errorMessage”:”##form.csrfInvalid##"}".
So i have two questions:
(1) why do i get the “csrf invalid” error and how i can fix it?
(2) ##form.csrfInvalid##" is a language problem? How can i fix it?

Thanks

Hi @ironsail,

What version of OJS are you using? (Please include this in your posts.)

Does anything appear in the PHP error log? When you look at the request and response that are supposed to create the journal using your browser’s developer tools, what response does the server give?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi,
My version is 3.2.0.2.
I found out the “csrf” problem only appears when i use “vpn” to access my ojs site. And it is successful to create the journal when i shut down the “vpn”. So i guess the cookie caused it, right?

Yes, i got the error message from developer tools:
POST http://47.92.207.63/ojs/index.php/*/api/v1/contexts 403 (Forbidden)

Request Info:

  1. Request URL:http://47.92.207.63/ojs/index.php/*/api/v1/contexts
  2. Request Method:POST
  3. Status Code:403 Forbidden
  4. Remote Address:167.179.92.46:443
  5. Referrer Policy:no-referrer-when-downgrade

Request Header:
HTTP/1.1 403 Forbidden
Date: Tue, 14 Apr 2020 04:16:05 GMT
Server: Apache/2.4.6 (CentOS) PHP/7.2.29
X-Powered-By: PHP/7.2.29
Set-Cookie: OJSSID=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/ojs/
Set-Cookie: OJSSID=d6kbr39cp41h8ooktqtbij3i41; expires=Thu, 14-May-2020 04:16:05 GMT; Max-Age=2592000; path=/ojs/; domain=47.92.207.63
Access-Control-Allow-Origin: *
Content-Length: 66
Content-Type: application/json
X-Cache: MISS from 167.179.92.46
X-Cache-Lookup: MISS from 167.179.92.46:1993
Connection: keep-alive

Response Header:
POST http://47.92.207.63/ojs/index.php/*/api/v1/contexts HTTP/1.1
Host: 47.92.207.63
Proxy-Connection: keep-alive
Content-Length: 129
Proxy-Authorization: Basic LnN2QDUzMjM5MDY7Y24uOkpva0QrVHczNVZqQkdvV1FPSmFlTFZ2cmduWTJtU3J3b3dIYlpjSlZQdGc9
Accept: /
Origin: http://47.92.207.63
X-Csrf-Token: b2da2d2da5a5a37e379739d9aa5e8828
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://47.92.207.63/ojs/index.php/index/admin/contexts
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: OJSSID=d6kbr39cp41h8ooktqtbij3i41

Response data:
{“error”:“form.csrfInvalid”,“errorMessage”:"##form.csrfInvalid##"}

Hi @ironsail,

See e.g.: Problem to set changes in OJS 3.2.0 admin page - #8 by Williams_Baster

Regards,
Alec Smecher
Public Knowledge Project Team

Hi,

I have another problem about language, so many texts show like “##navigation.archives##”, how i can fix it?
btw, i use the chinese.

Hi @ironsail,

Next time, I’d suggest starting a new topic when you have an unrelated question – it helps to keep the forum organized. However, when you see text like ##something.here## it means that locale key couldn’t be translated. This usually happens because the translation is incomplete. See Introducing Weblate, a new path for OJS & OMP translations for information about how to update/complete translations of the software.

Regards,
Alec Smecher
Public Knowledge Project Team