Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8332625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:46:37+00:00 2026-06-09T02:46:37+00:00

Sorry if this is a silly question but lately I’ve been designing a site

  • 0

Sorry if this is a silly question but lately I’ve been designing a site for a client and something strange has been happening with my sessions.

The site has a PayPal button which redirects the user to PayPal so they can confirm a payment, before being redirected to the site again.

Before the user is redirected, a load of session variables are saved. Some of them are to do with PayPal, others are to do with things on my site such as a variable to determine which user is logged in, their shopping cart items, etc.

Now, here’s where things have been going wrong…

The user is redirected from checkout.php to PayPal. Before they’re redirected, all session variables for the site are present (shown by var_dump and print_r). This is fine.

The user returns from PayPal to orderreview.php, but var_dump and print_r now show that the site session variables are missing, but all PayPal ones are there.

I fixed this problem by removing “session_start();” from the top of orderreview.php.

So my question is, why did removing that line fix the issue? Why wouldn’t it work before?

I thought I understood PHP sessions but clearly I don’t understand them as well as I thought.

I’d read this somewhere:

“As of PHP 4.3.3, calling session_start() while the session has already been started will result in an error of level E_NOTICE. Also, the second session start will simply be ignored.”

So I was under the assumption that calling session_start at the top of the script wouldn’t affect anything if a session was already started earlier.

Thanks for any answers, once again I apologise if this is a silly question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T02:46:39+00:00Added an answer on June 9, 2026 at 2:46 am

    That’s may be because that you have been redirected to another site during the process. And while you return from Paypal to your website, session_start() generated a new session id which your previously stored session variables are not linked to.

    And when you removed session_start() (I don’t think session should work without this on top), it used the old session id and never got regenerated. Hence, old session data are back!

    This is just my assumption.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry if this is a silly question or if it's been answered already, but
I am sorry if this is a silly question but I have been working
Sorry if this is a silly question but I have been on web design
Sorry if this is a silly question. But I've been struggling with this for
Sorry if I missed something and this is a silly question...but can I enter
Sorry for this silly question, but is there any way to restrict using directives
Sorry if this question sounds a little silly, but I am not sure what
Sorry for such a trivial question, but I'd feel silly building this if it
I'm using Symfony 1.4 with Doctrine. Sorry if this is a silly question but
Sorry if this sounds like a really silly question. But I Googled the web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.