How to delete a php session by name For example, I session['sec'] and session['page'] I need to delete session['page'] without deleting session['sec']
session['sec']
session['page']
// 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();
This should do it:
unset($_SESSION['page']);
In this case, you are not deleting the session, but only the session variable. So simple:
Source: https://habr.com/ru/post/1238302/More articles:How to destroy two different sessions in the same PHP script? - phphttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1238298/jsoup-seems-to-be-caching-can-i-disable-this&usg=ALkJrhgYdZfkhdQEQlq_tcHEyEm03_3N3wHow to disable glimpse update check request? - c #How to save 2 Cassandra tables inside one partition - cassandraCustom gesture needed to start playing HTML5 Android player - javascriptImportError: dynamic module does not define module export function (PyInit__caffe) - pythonCustom Behavior Type (UDT) in Kassandra - cassandraHorizontal RecyclerView with starter add-on - androidCreating a custom JSON array - jsonXampp update to run php 7 - phpAll Articles