Cookie设置不正确

时间:2019-04-05 16:06:36

标签: php setcookie

我遇到了无法创建Cookie的问题。我直接在其后设置了另一个cookie,并且该cookie可以正常工作。所以我知道这不是以前的输出,也不是不会导致创建任何Cookie的东西。

我尝试打印出我将其设置为的变量,并且该代码在代码中的同一点工作得很好,所以我知道它存在并具有内容。它们的值包含大量数据,但不超过可以在cookie中设置的数据。如果需要的话,我将提供该变量的内容,但这是用于创建测试的信息,因此它具有约100个问题ID,并且有点冗长……任何帮助都将是惊人的。请记住,我直接设置了一个cookie,就可以了。我也有一个适用于不同类型测试的另一个版本,该版本也能正常工作,但是它没有太多问题,因此它的大小要小一些。谢谢

这是电话:

setcookie("testinginfo", json_encode($_SESSION['simulation']), time() + (86400 * 30)); 

这是$ _SESSION ['simulation']的输出:

Array ( [mode] => multipage [category] => 0 [questions] => Array ( [1102] => Array ( [id] => 1102 ) [634] => Array ( [id] => 634 ) [2047] => Array ( [id] => 2047 ) [155] => Array ( [id] => 155 ) [2046] => Array ( [id] => 2046 ) [284] => Array ( [id] => 284 ) [3064] => Array ( [id] => 3064 ) [760] => Array ( [id] => 760 ) [641] => Array ( [id] => 641 ) [2857] => Array ( [id] => 2857 ) [722] => Array ( [id] => 722 ) [3305] => Array ( [id] => 3305 ) [100] => Array ( [id] => 100 ) [921] => Array ( [id] => 921 ) [1098] => Array ( [id] => 1098 ) [440] => Array ( [id] => 440 ) [101] => Array ( [id] => 101 ) [556] => Array ( [id] => 556 ) [1507] => Array ( [id] => 1507 ) [805] => Array ( [id] => 805 ) [2035] => Array ( [id] => 2035 ) [2868] => Array ( [id] => 2868 ) [856] => Array ( [id] => 856 ) [1035] => Array ( [id] => 1035 ) [1382] => Array ( [id] => 1382 ) [1533] => Array ( [id] => 1533 ) [21] => Array ( [id] => 21 ) [182] => Array ( [id] => 182 ) [2447] => Array ( [id] => 2447 ) [338] => Array ( [id] => 338 ) [471] => Array ( [id] => 471 ) [929] => Array ( [id] => 929 ) [2763] => Array ( [id] => 2763 ) [1615] => Array ( [id] => 1615 ) [13] => Array ( [id] => 13 ) [2819] => Array ( [id] => 2819 ) [217] => Array ( [id] => 217 ) [905] => Array ( [id] => 905 ) [2345] => Array ( [id] => 2345 ) [495] => Array ( [id] => 495 ) [927] => Array ( [id] => 927 ) [1028] => Array ( [id] => 1028 ) [694] => Array ( [id] => 694 ) [930] => Array ( [id] => 930 ) [649] => Array ( [id] => 649 ) [2053] => Array ( [id] => 2053 ) [1440] => Array ( [id] => 1440 ) [87] => Array ( [id] => 87 ) [31] => Array ( [id] => 31 ) [1685] => Array ( [id] => 1685 ) [89] => Array ( [id] => 89 ) [2791] => Array ( [id] => 2791 ) [28] => Array ( [id] => 28 ) [342] => Array ( [id] => 342 ) [701] => Array ( [id] => 701 ) [4] => Array ( [id] => 4 ) [3077] => Array ( [id] => 3077 ) [1506] => Array ( [id] => 1506 ) [327] => Array ( [id] => 327 ) [418] => Array ( [id] => 418 ) [1505] => Array ( [id] => 1505 ) [478] => Array ( [id] => 478 ) [2382] => Array ( [id] => 2382 ) [1605] => Array ( [id] => 1605 ) [565] => Array ( [id] => 565 ) [311] => Array ( [id] => 311 ) [336] => Array ( [id] => 336 ) [1166] => Array ( [id] => 1166 ) [3073] => Array ( [id] => 3073 ) [3225] => Array ( [id] => 3225 ) [476] => Array ( [id] => 476 ) [679] => Array ( [id] => 679 ) [3093] => Array ( [id] => 3093 ) [2672] => Array ( [id] => 2672 ) [2048] => Array ( [id] => 2048 ) [1186] => Array ( [id] => 1186 ) [945] => Array ( [id] => 945 ) [1014] => Array ( [id] => 1014 ) [2409] => Array ( [id] => 2409 ) [1500] => Array ( [id] => 1500 ) [2426] => Array ( [id] => 2426 ) [2958] => Array ( [id] => 2958 ) [2034] => Array ( [id] => 2034 ) [2562] => Array ( [id] => 2562 ) [630] => Array ( [id] => 630 ) [1614] => Array ( [id] => 1614 ) [2343] => Array ( [id] => 2343 ) [643] => Array ( [id] => 643 ) [2716] => Array ( [id] => 2716 ) [2777] => Array ( [id] => 2777 ) [635] => Array ( [id] => 635 ) [496] => Array ( [id] => 496 ) [2889] => Array ( [id] => 2889 ) [2305] => Array ( [id] => 2305 ) [504] => Array ( [id] => 504 ) [2326] => Array ( [id] => 2326 ) [2370] => Array ( [id] => 2370 ) ) [ids] => 1102,634,2047,155,2046,284,3064,760,641,2857,722,3305,100,921,1098,440,101,556,1507,805,2035,2868,856,1035,1382,1533,21,182,2447,338,471,929,2763,1615,13,2819,217,905,2345,495,927,1028,694,930,649,2053,1440,87,31,1685,89,2791,28,342,701,4,3077,1506,327,418,1505,478,2382,1605,565,311,336,1166,3073,3225,476,679,3093,2672,2048,1186,945,1014,2409,1500,2426,2958,2034,2562,630,1614,2343,643,2716,2777,635,496,2889,2305,504,2326,2370 [order] => question_id=2370,question_id=2326,question_id=504,question_id=2305,question_id=2889,question_id=496,question_id=635,question_id=2777,question_id=2716,question_id=643,question_id=2343,question_id=1614,question_id=630,question_id=2562,question_id=2034,question_id=2958,question_id=2426,question_id=1500,question_id=2409,question_id=1014,question_id=945,question_id=1186,question_id=2048,question_id=2672,question_id=3093,question_id=679,question_id=476,question_id=3225,question_id=3073,question_id=1166,question_id=336,question_id=311,question_id=565,question_id=1605,question_id=2382,question_id=478,question_id=1505,question_id=418,question_id=327,question_id=1506,question_id=3077,question_id=4,question_id=701,question_id=342,question_id=28,question_id=2791,question_id=89,question_id=1685,question_id=31,question_id=87,question_id=1440,question_id=2053,question_id=649,question_id=930,question_id=694,question_id=1028,question_id=927,question_id=495,question_id=2345,question_id=905,question_id=217,question_id=2819,question_id=13,question_id=1615,question_id=2763,question_id=929,question_id=471,question_id=338,question_id=2447,question_id=182,question_id=21,question_id=1533,question_id=1382,question_id=1035,question_id=856,question_id=2868,question_id=2035,question_id=805,question_id=1507,question_id=556,question_id=101,question_id=440,question_id=1098,question_id=921,question_id=100,question_id=3305,question_id=722,question_id=2857,question_id=641,question_id=760,question_id=3064,question_id=284,question_id=2046,question_id=155,question_id=2047,question_id=634,question_id=1102 [current] => 0 [last] => 96 [type] => 1 [limit] => 105 [start] => 1554479518 )

0 个答案:

没有答案