SESSION_DESTROY(3) 1 SESSION_DESTROY(3)session_destroy - Destroys all data registered to a sessionSYNOPSIS
bool session_destroy (void )
DESCRIPTION session_destroy(3) destroys all of the data associated with the current session. It does not unset any of the global variables associated
with the session, or unset the session cookie. To use the session variables again, session_start(3) has to be called.
In order to kill the session altogether, like to log the user out, the session id must also be unset. If a cookie is used to propagate the
session id (default behavior), then the session cookie must be deleted. setcookie(3) may be used for that.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Destroying a session with $_SESSION
<?php
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
session_start();
// Unset all of the session variables.
$_SESSION = array();
// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
setcookie(session_name(), '', time() - 42000,
$params["path"], $params["domain"],
$params["secure"], $params["httponly"]
);
}
// Finally, destroy the session.
session_destroy();
?>
NOTES
Note
Only use session_unset(3) for older deprecated code that does not use $_SESSION.
SEE ALSO unset(3), setcookie(3).
PHP Documentation Group SESSION_DESTROY(3)
Check Out this Related Man Page
SESSION_UNREGISTER(3) 1 SESSION_UNREGISTER(3)session_unregister - Unregister a global variable from the current sessionSYNOPSIS
bool session_unregister (string $name)
DESCRIPTION session_unregister(3) unregisters the global variable named $name from the current session.
Warning
This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
PARAMETERS
o $name
- The variable name.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
NOTES
Note
If $_SESSION (or $HTTP_SESSION_VARS for PHP 4.0.6 or less) is used, use unset(3) to unregister a session variable. Do not
unset(3)$_SESSION itself as this will disable the special function of the $_SESSION superglobal.
Caution
This function does not unset the corresponding global variable for $name, it only prevents the variable from being saved as part of
the session. You must call unset(3) to remove the corresponding global variable.
Caution
If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(3), session_is_registered(3) and session_unregis-
ter(3).
PHP Documentation Group SESSION_UNREGISTER(3)
Hi,
when I make a mistake and then try to backspace I am unable to do so . Can someone please suggest How I can correct this on my session
For Eg:
pwd^H^H^H
Thanks
rooh (2 Replies)
hi,
does anyone knows how to trace a user session on a unix system:
i want to log these things
1- login
2- date of starting session
3- date of closing session
i've tryed who and last but they don't give closing time of session
regards
hmaiida (2 Replies)
Hi there.
How do I make the DB connection see the parameter variables passed to the unix script ? The code snippet below isn't working properly.
sqlplus << EOF
user1@db1/pass1
BEGIN
PACKAGE1.perform_updates($1,$2,$3);
END;
EOF
Thanks in advance,
Abrahao. (2 Replies)
I logged on yesterday and ran something that made my ID hang. I X'd out of the session and then logged on again and my ID from the original session is still there. I checked again this morning and the ID is still there (I checked using the WHO command). How can I kill that first session using... (7 Replies)
Apologies if this isn't quite the right thread
I have a vi session and I have set a lot of tags with 'mx'. can I save this session preserving these tags so when I go back to the session I don't have to reset them all?
cheers (0 Replies)
Hi All,
I logged into a sun microsystems server box, using both a vnc session and a ssh session. I am able to use "ifconfig -a" in a ssh session, but the same on a vnc session says that its a invalid command. how is this possible, when i am logging into the same box through two different... (4 Replies)
During the course of the session before I logout I see some of the commands listed from my previous session but not from my current session and after I logout and log back in I see the commands which I ran before logging out.
Does the .bash_history stay in the buffer or someplace else then?
... (2 Replies)
Hello,
When I connect to a HP-UX 11.23 and/or 11.31 after a time without activity, the session hang.
There is not TMOUT stablished, and the session NOT finish, always keep hang after about 20min of inactivity period.
Anyone knows if this problem is related to HP-UX or network... (1 Reply)
hi ..
i have a isql session which inside which i have two variables defined.. i wanna calculate % based on those variables. i knw i can easily do % calculation in csh if i could get the value of these variables passed outside the isql session . is tat possible ?? pls advice
somthin like below... (1 Reply)
Below code runs n number of session at a time when called. I want to restrict it to run only for 3 sqlplus at a time. Is there a way to do the same.
for name in `cat abc.txt`
do
(sqlplus -s usert/password@host <<-EOF>> error.txt
SET LINESIZE 1000
select '$name',... (4 Replies)