Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get session id in php and show it? [closed]

Tags:

php

session

I need to use some unique id like session id. How can I get session id in php?

like image 492
AliM Avatar asked Jan 23 '14 08:01

AliM


People also ask

How can I know my 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.

What is $_ 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.

How does PHP generate session ID?

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.


1 Answers

session_start();     echo session_id(); 
like image 79
zerokavn Avatar answered Oct 04 '22 14:10

zerokavn