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 "<tr><td width=200>_xoopsConfig[" . $key . "] </td><td> " . $req . "</td></tr>";
$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 "<br>session_id 1: " . session_id($_COOKIE[$xoopsConfig['session_name']]);
echo "<br>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 "<br><br>" . $sname ." : " .$svalue. "<br>";
foreach ($svalue as $vname => $vvalue){
echo $vname ." : " .$vvalue. "<br>";
}
}
// this will display the cookie
foreach ($_COOKIE as $name => $value){
echo $name ." : " .$value. "<br>";
}

}

Hope this helps

Login

Who's Online

67 user(s) are online (30 user(s) are browsing Support Forums)


Members: 0


Guests: 67


more...

Donat-O-Meter

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

Latest GitHub Commits