You are viewing the PKP Support Forum | PKP Home Wiki

Working with Cookies

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

Working with Cookies

Postby ruizjulian » Thu Oct 21, 2010 7:31 am

Hello forum geeks, I am a OJS Newbie and I am working with OJS Cookies but I can't understand how it works, if there are encrypted or how OJS can read it?

My goal is setting the "currentLocale" variable outside of OJS, setting the language in "en_EN" parameter because the default language in my OJS installation is "es_ES".

I read other post where OJS use setLocale method where:

$locale = $session->getSessionVar('currentLocale');

But I can't find the variables on the session cookie.

Thank you for your help.
Posts: 4
Joined: Mon Aug 23, 2010 12:32 pm

Re: Working with Cookies

Postby asmecher » Thu Oct 21, 2010 8:59 am

Hi ruizjulian,

Session variables are stored on the server side, and PHP sends only a single cookie to the user to identify which server-side session the user owns. If you need something that's also available on the client side (i.e. to Javascript), you'll need to use the PHP setcookie function or something similar. (See http://ca3.php.net/manual/en/function.setcookie.php.)

Alec Smecher
Public Knowledge Project Team
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Return to OJS Development

Who is online

Users browsing this forum: No registered users and 2 guests