Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Delete session by the name

Tags:

php

How delete php session by the name example i have session['sec'] and session['page'] i need to delete session['page'] with out delete session['sec']

like image 370
choppermio Avatar asked Dec 01 '25 05:12

choppermio


1 Answers

// for a single variable
unset($_SESSION['session_var']); 

// destroy the Session, not just the data stored!
session_destroy();

// delete the session contents, but keep the session_id and name:
session_unset();
like image 145
Vishal Avatar answered Dec 03 '25 22:12

Vishal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!