answersLogoWhite

0

Depends what you mean with that. If the user logs out, the session gets destroyed, and with it the session ID. You'd need to grab the session ID before the user logs out.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

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.


How do you reset session variables?

<?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 ?>


WHAT is the difference between session and cookie in php?

The session is stored on the web server. The cookies is stored in a little file on users machine. This means that the session is (relatively) secure, whereas the cookie can be edited by the end user.


Why do you use sessions in PHP?

There are a lot of reasons to use session. Mostly to keep sensitive data housed on the server (and not on user's computer in cookies). It is also a much easier and more dynamic way to store data than Cookies, and far more reliable than constant GET or POST passing. As http is a stateless transaction, there's no way to tell what the user i.e. in a shop wants to buy, or has already stored. In come PHP sessions, which are carrying an ID and are stored similar to cookies in your browser. Usually a session is lost as soon as the browser closes or the user logs off. It furthermore helps to keep information private between the user and the server machine.


What is session and how it is create in asp dot net?

In ASP.NET, a session is a server-side storage mechanism that enables the storage of user-specific data across multiple requests during a user's session with a web application. A session is created when a user first accesses the application, and a unique session ID is generated and sent to the client as a cookie or through the URL. Developers can store and retrieve data in the session using the Session object, allowing them to maintain state information, such as user preferences or authentication details, throughout the user's interaction with the application. Sessions typically expire after a specified period of inactivity or when the user explicitly logs out.


What causes the sesions to change?

Sessions can change due to factors such as user inactivity, session timeout settings, manual logouts, or changes in the user's IP address or device._sessions can change due to factors such as inactivity, session timeout, mechanism set by the server or service, or when a user logs out manually.


What nis meant by session in php?

A session is a file on the server (sometimes is a database entry) that allows the web application to track the user. Whenever you "login" to something, that's a session. Sessions are most often used to determine a users level of access and privileges.


Write down a PHP code to add a session variable?

The preferred way is to simply alter the session superglobal. <?php $_SESSION['variable'] = "value"; ?>


What is the purpose of a PHP session?

A PHP session serves quite a few purposes. PHP sessions store data that the web application developer would like to have preserved across the different page loads.


How do you clear session?

To clear a session in a web application, you can typically use the session management functions provided by your server-side technology. For example, in PHP, you can call session_destroy() to terminate the session, or in Node.js with Express, you can use req.session.destroy(). Additionally, you can clear session data on the client side by deleting cookies associated with the session. Always ensure to handle user logout properly to maintain security.


What is the HTML for not letting someone access the same page twice in the same session?

HTML does not provide session handling. If you are using PHP for sessions though, you could simply check whether a session exists before the page is built up and return an error if there is already one. Of course you will have to watch out with that, because it's possible that the session hasn't been closed when the user left the page, i.e. it might happen that a user is opening the page for the first time but already has an existing session anyway.


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: <?php // Start session session_start(); // Set some variables (this simulates form input) $_SESSION['answers']['Q1'] = 18; $_SESSION['answers']['Q2'] = 36; $_SESSION['answers']['Q4'] = "Fred"; ?> ============================= Hope that helps...