sequence in php processing

I have a web page where I am resetting  some session variables and and I also display the value of the session variable

<a href="W4_User_Quote_History.php"> User: <?php echo $_SESSION['CurrentUser']; ?></a>

I want the displayed value to be "Guest" , but it is not.  It shows the value before it is reset to "Guest".    I suspect it is because it is server-side php.
Is there a way to echo the session variable post the reassignment?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mark BradyPrincipal Data EngineerCommented:
Can you show some more of the code. Session variables hang around (keep their values that have been assigned to them) for every php page/script that has a session_start() as it's 1st statement.  It would be very hard to diagnose without knowing what is in any/all included files on the page that is giving you the issue.  The good news is it will be super-duper easy to diagnose where the issue is once we see the code.

For starters, on the page that is giving you problems, somewhere after session_start();  yuo should dump out what is in them.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jws2bayAuthor Commented:
Hi Mark,

Thanks for the replay.  Your reply made me examine my code a little closer.  Missing  the session_start() statement.  Sometimes
the obvious is hard to see.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.