I need to use some unique id like session id. How can I get session id in php?
Check Session ID With session_id() Function Before you can check for a session ID, you need to start a PHP session with session_start() . Afterward, you can call on the session_id() function. This function will return the current session id.
A session ID is a unique number that a Web site's server assigns a specific user for the duration of that user's visit (session). The session ID can be stored as a cookie, form field, or URL (Uniform Resource Locator). Some Web servers generate session IDs by simply incrementing static numbers.
Session ID is created according to php. ini settings. It is important to use the same user ID of your web server for GC task script. Otherwise, you may have permission problems especially with files save handler.
session_start(); echo session_id();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With