S
S
SoloMidPlzD2016-02-23 21:49:19
PHP
SoloMidPlzD, 2016-02-23 21:49:19

Learn the value from another session?

I suffer for a day, I can’t take the value from another session in any way.
The main site is on codeigniter, + there is also a roundcube mailer script. The problem is that you need a login password for the script to autologin.
That is, in the script with the roundcube_sessid session, take the value from the ci_session session.
First, I put the name in the ci_session parameters in both scripts, but this did not work.
Then I tried to select the ci_session session in the script with the roundcube session started:

var_dump($_SESSION);
    session_destroy();
    $_COOKIE['roundcube_sessid'] = $_COOKIE['ci_session'];
    session_start();
    var_dump($_SESSION);
    session_destroy();
    session_id($_COOKIE['ci_session']);
    session_start();
    var_dump($_SESSION);
    session_destroy();
    session_name('ci_session');
    session_start();
    var_dump($_SESSION);

But it didn't work either.
Here is the session difference (from phpinfo):
Directive	Local Value
session.cookie_lifetime	7200	
session.gc_maxlifetime	7200	
session.hash_bits_per_character	4
session.hash_function	1
session.name	ci_session
session.save_handler	user

Directive	Local Value
session.cookie_lifetime	0
session.gc_maxlifetime	1200
session.hash_bits_per_character	5
session.hash_function	0
session.name	roundcube_sessid
session.save_handler	files

help plz

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Nikolaev, 2016-02-23
@SoloMidPlzD

You can't get the value of another session, otherwise it would be heaven for hackers of all stripes and sizes. If your architecture does not allow you to pass a value through $_SESSION, use a database and a table of the memory type (so as not to bother with cleaning).
But for good, if both scripts are placed in the same place, the algorithm should work:
- enter the value in $_SESSION
- read the entered value in another place

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question