How to get session_id in PHP?

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

How to get session_id in PHP?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by darion , 7 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;