How to get session_id in PHP?

Member

hal.littel

by hal.littel, in category: PHP General , 4 months ago

How to get session_id in PHP?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by darion , 3 months ago

@hal.littel you can use session_id() function to get session_id in PHP, code:


1
2
3
4
5
6
7
8
9
<?php

// Start session
session_start();

// Get session id
$id = session_id();

echo $id;