Is there a Java library for decoding php session data?

I am working on an application that mixes php and Java. I need to enter some values โ€‹โ€‹into a php session through Java, but for this I need to be able to parse the values โ€‹โ€‹of a php session in a set. Is there a library that will allow me to undo in java what session_encode does in php?

+4
source share
1 answer

You can configure the PHP environment to store session data in WWDX format http://www.php.net/manual/en/session.configuration.php#ini.session.serialize-handler

session.serialize_handler defines the name of the handler which is used to serialize/deserialize data. Currently, a PHP internal format (name php or php_binary) and WDDX are supported (name wddx). WDDX is only available, if PHP is compiled with WDDX support. Defaults to php.` 

About WDDX:

The Web Distributed Data Exchange, or WDDX, is a free, open XML-based technology that allows Web applications created with any platform to easily exchange data with one another over the Web.

and Java WDDX Parser are available through googling :) http://www.google.com.ua/search?q=java+wddx+parser

Of course, this solution is more complicated than just writing a simple parser class - the PHP session format is very simple.

+2
source

Source: https://habr.com/ru/post/1333700/


All Articles