answersLogoWhite

0

<?php

// start session

session_start();

// Assign value to session

$user = $_SESSION['variable_name']; // variable_name = value to store in session

// To reset session variable use below method

unset($user);

// If you want to destroy all session variables use below method

session_destroy(); // destroys all session variables

?>

User Avatar

Wiki User

11y ago

What else can I help you with?

Related Questions

What variables are maintained while the browser is opened?

Session Variables


How do you set the session variables in jsp?

The session variables can be accessed in a jsp page from the request object. Note: Accessing session contents in JSP is not a good design practice


HOW CAN WE REGISTER THE VARIABLES INTO A SESSION?

$_SESSION['name'] = "RAGHAV";


How do you reset Study Island session?

Oh, dude, it's like super easy. To reset your Study Island session, you just need to log out and then log back in. It's like hitting the refresh button on your browser, but for your brain. So, yeah, just a little digital reset and you're good to go.


How do you maintain a session in a PHP quiz script?

All you have to do to maintain a session is start it before you call any variables. Once you've started the session, you can store variables for use in later scripts. Beware though, once the user closes the browser, the sessions' over. I'd use the following SCRIPT 1: &lt;?php // Start session session_start(); // Set some variables (this simulates form input) $_SESSION['answers']['Q1'] = 18; $_SESSION['answers']['Q2'] = 36; $_SESSION['answers']['Q4'] = "Fred"; ?&gt; ============================= Hope that helps...


What is a php session?

A PHP session is a concept where specific variables (and their respective values) are carried throughout a user's viewing of a PHP-driven website. These sessions can be initialized and continued using the session_start() function. The session values are stored in the $_SESSION global variable. For more information, see the php.net documentation of session functions.


Connection reset by peer?

You will usually see this message when you have timed out of a session on a network, or the connection was interrupted for some reason.


How do you write a script which lists the 10 Shell System variables?

You don't need a shell script to do that. Since you don't say what 10 shell variables you want, you can list them all by using the 'set' command to list all known in-use shell variables in the current session.


Can you store the two variables with different values but having same name in session object?

Yes you can store it but the value which is assigned at the last will be accessed when the value is displayed.


How do you spell the word session?

The correct spelling is &quot;session.&quot;


What is a period of time during which a legislature meets to conduct business?

A session of congress


A session of congress when both member of both houses meet together?

Joint session