Doc #79609 [Com]: Warning in session_create_id Example #1
| From: | software_onbekend at hotmail dot com | Date: | Tue, 19 May 2020 15:59:56 +0000 |
| Subject: | Doc #79609 [Com]: Warning in session_create_id Example #1 | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-17602@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79609&edit=1
ID: 79609
Comment by: software_onbekend at hotmail dot com
Reported by: software_onbekend at hotmail dot com
Summary: Warning in session_create_id Example #1
Status: Feedback
Type: Documentation Problem
Package: Session related
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Session Support enabled
Registered save handlers files user
Registered serializer handlers php_serialize php php_binary
Directive Local Value Master Value
session.auto_start Off Off
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_httponly no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_samesite no value no value
session.cookie_secure 0 0
session.gc_divisor 1000 1000
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.lazy_write On On
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path E:\xampp\tmp E:\xampp\tmp
session.serialize_handler php php
session.sid_bits_per_character 5 5
session.sid_length 26 26
session.upload_progress.cleanup On On
session.upload_progress.enabled On On
session.upload_progress.freq 1% 1%
session.upload_progress.min_freq 1 1
session.upload_progress.name PHP_SESSION_UPLOAD_PROGRESS PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.prefix upload_progress_ upload_progress_
session.use_cookies 1 1
session.use_only_cookies 1 1
session.use_strict_mode 0 0
session.use_trans_sid 0 0
I hope, this is the info you asked for.
Have a nice day.
Previous Comments:
------------------------------------------------------------------------
[2020-05-18 21:14:58] requinix@php.net
The only way I see session_create_id failing is either (a) you don't have good enough crypto,
or (b) you're using a custom session handler that's not behaving well.
So what are you session settings?
------------------------------------------------------------------------
[2020-05-18 19:03:35] software_onbekend at hotmail dot com
Exact warning: from def. environment:
Warning: session_create_id(): Failed to create new ID in E:\xampp\htdocs\8\index.php on line 20
------------------------------------------------------------------------
[2020-05-18 18:17:05] requinix@php.net
> Here I get the warnings.
Exactly what are they?
> The explanation of the return values doesn't explain the link between these values 0, 1
> & 2.
Use the constants. If you want something you can read, use the constants to output human friendly
strings like "active".
------------------------------------------------------------------------
[2020-05-18 17:21:31] software_onbekend at hotmail dot com
The def. environment is PHP 7.4.3 (xamp installation on Windows).
session.auto_start = "Off".
"display_errors" and "display_startup_errors" values are "On".
Here I get the warnings.
Tested example in prod. environment with PHP 7.3.17.
session.auto_start = "Off"
No warning because the most hosted platform has the "display_errors" and
"display_startup_errors" at "Off" so the warnings and errors are suppressed. No
output to webbrowser.
About the session-status.
echo session_status; gives int. as answer in the browser (values 0 or 1 or 2)
The explanation of the return values doesn't explain the link between these values 0, 1 &
2.
The contributed note from "sasi dot viragelet at gmail dot co" gives the answer.
Perhaps we can use that info to improve the documentation.
Just my 2 cents.
Have a nice day.
------------------------------------------------------------------------
[2020-05-17 21:59:23] a at b dot c dot de
For the first question: The sample code is working fine for me.
What version are you using?
Do you perhaps have session.auto_start enabled?
For the second question: PHP_SESSION_ACTIVE is an integer.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=79609
--
Edit this bug report at https://bugs.php.net/bug.php?id=79609&edit=1