S
S
Sergey Beresnev2012-07-11 13:41:12
PHP
Sergey Beresnev, 2012-07-11 13:41:12

What is the format for storing session data in PHP?

There was a need to work with the saved session data directly.

I put some data in the session, for example

$_SESSION['id'] = 100500;


In the place where the session is saved, I expect to see:
id|i:100500;
but I get
Ilsl4dNDgOPRqC2FwZ-OxeBxcn1qtO6IbkFAEh1zfoQ.
.

In the settings is:
session.serialize_handler=php

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Melkij, 2012-07-11
@sectus

Dig in the direction of suhosin.session. * (especially suhosin.session.encrypt, the name is too hinting)

A
Alexey Zhurbitsky, 2012-07-11
@blo

Is the code shown a real example or just for demonstration purposes? If the demonstration is actually more complicated, then it is possible to use your own serialize_handler, set via session_set_save_handler and using a binary format.

V
Vitaly Zheltyakov, 2012-07-11
@VitaZheltyakov

Some kind of perversion ...
Use files or a cache if you need to transfer / change some user data. By changing sessions directly, you risk running into data loss or blocking.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question