1
mschmid
how to read sessionid in version 2.5
  • 2011/1/13 0:10

  • mschmid

  • Just popping in

  • Posts: 28

  • Since: 2002/9/19


Hi Gurus

in earlier version it was possible to get the session id:

echo session_id();
or
echo "session_id: " . session_id($_COOKIE[$xoopsConfig['session_name']]);

now it is empty ?!

if I do read out the xoops config, I get the session id:

foreach ($xoopsConfig as $key => $req) {
echo "_xoopsConfig[" . $key . "] " . $req . "";
$n = $n + 1;
}

==> How can I read / access the session ID

any hint will help
Markus

2
mschmid
Re: how to read sessionid in version 2.5
  • 2011/1/13 0:45

  • mschmid

  • Just popping in

  • Posts: 28

  • Since: 2002/9/19


Sorry I do not see the seesionid in the xoops config.

If I do twice the following I only get once the session ID:

echo "
session_id 1: " . session_id($_COOKIE[$xoopsConfig['session_name']]);
echo "
session_id 2: " . session_id($_COOKIE[$xoopsConfig['session_name']]);

Output:
session_id 1: cif3msoorkoct6co9pi010ctjm
session_id 2:

what do I wrong?

3
builderb
Re: how to read sessionid in version 2.5
  • 2011/1/20 1:00

  • builderb

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/8/4 2


Try This:


if (isset($_COOKIE)){
$sessionID = $_COOKIE['PHPSESSID'];

// this will display the session variable(s)
foreach ($sessionID as $sname => $svalue){
echo "

" . $sname ." : " .$svalue. "
";
foreach ($svalue as $vname => $vvalue){
echo $vname ." : " .$vvalue. "
";
}
}
// this will display the cookie
foreach ($_COOKIE as $name => $value){
echo $name ." : " .$value. "
";
}

}

Hope this helps

Login

Who's Online

428 user(s) are online (61 user(s) are browsing Support Forums)


Members: 0


Guests: 428


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits