1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jeka94
2 years ago
6

What code do I have to use in my php if i don’t want my $_SESSION[“variablex”] to destroy? But i already have a session_destroy(

) above the code that needs to be there. Or maybe there is an alternative?
So i want to destroy all my sessions EXCEPT $_SESSION[“variablex”]
Computers and Technology
1 answer:
Vesnalui [34]2 years ago
5 0

Answer:

See Explanation Below

Explanation:

Follow the steps below.

1. Start Session

2. Assign the session you want to preserve ( $_SESSION['variablex'] ) to a variable

3. Destroy all session (including the one you want, $_SESSION['variablex'])

4. Reassign the contents of the variable you created in (1) above to $_SESSION['variablex'].

The code is as follows (comments explain each line)

<?php

session_start(); // Start session

$variable = $_SESSION['variablex'] ; // assign $_SESSION['variablex'] to $variable

session_destroy(); // Destroy sessions

$_SESSION['variablex'] = $variable; // assign $variable back to $_SESSION['variablex'] to

// You can continue your code (if you have any), here

// End of solution

?>

You might be interested in
Which method tries all possible passwords until a match is found?
barxatty [35]
Brute force is this approach to password cracking. It tires all possible password combinations until a correct match between the hashes is found. It may make use of rainbow tables which contain precomputed password-hash combinations.

Please remember that it helps to provide the choices that match your question. This can help you get an accurate answer and have your question answered much quicker.
7 0
3 years ago
What character separates the file extension and the filename?
PtichkaEL [24]
A period, Filenamehere.png or .pdf or any other file extension
5 0
2 years ago
Read 2 more answers
You are called to assist in troubleshooting a network problem that has occurred soon after a significant IPv6 implementation. So
HACTEHA [7]

Answer:i dont kowe

Explanation:

5 0
2 years ago
What is one advantage of using the sharing tab vs. the security tab to give out permissions?
Hoochie [10]

Answer:

Depending on what operating system you have my best choice would be D since on some folders you can share permissions with other people. It really depends on what computer you're talking about.  

8 0
3 years ago
Derek has an interest in designing video games. What requirements should he fulfill to be a game designer? To be a game designer
4vir4ik [10]

Answer:

2. Marketing, communication or advertising

Explanation:

5 0
2 years ago
Other questions:
  • Which of the following is a justification for giving a Page Quality (PQ) rating of Lowest? Select all that apply. True False The
    7·1 answer
  • You can double-click a window’s title bar to maximize the window. true false
    9·1 answer
  • What is the f(n) runtime of the following pseudocode: sum-0 for A = N/2 downto 1 for B-1 t increment sum by B Explain: exactly w
    13·1 answer
  • Your desktop computer monitor is not displaying a picture. What would you do to troubleshoot the problem?
    7·2 answers
  • Identify the false statement.
    8·1 answer
  • When searching for an image on your computer, you should look for a file with which of the following extensions?
    8·1 answer
  • When does MMF2 inactivate an Active object? A. When the score is higher than the game's previous high score B. When the player d
    15·1 answer
  • Why won't Brainly let me send a link? This is just du*mb! I want to send good articles explaining a content, and this site just
    5·1 answer
  • What is a command-line program?
    8·2 answers
  • Customizable diagrams, including List, Process, and Cycle diagrams, are built into Word and can be found in
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!