|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-05-15 08:23 UTC] tony2001@php.net
[2006-05-15 10:48 UTC] grueff at libero dot it
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 13:00:02 2025 UTC |
Description: ------------ If i put values in $_SESSION array by inserting them as array elements such as this: $_SESSION["a"]="test"; All does function ok; but if i prepare a whole array of values and put it in the session such as this: $prep=array("test1","test2","test3","test4"); $_SESSION=$prep; NOTHING gets written in the session, and any subsequest pages loading the session will get an empty session array. Reproduce code: --------------- This writes the session <?php session_start(); $tize=array("uno","due","tre","quattro","cinque","sei"); $_SESSION=$tize; print_r($_SESSION); ?> This tries to read the session: <?php session_start(); print_r($_SESSION); ?> Expected result: ---------------- Output the content of $tize array! Actual result: -------------- Outputs an empty array!