Jump to content

so a weird situation with my shopping cart


zang8027

Recommended Posts

I got this shopping cart set up and these sessions set up. Now, if the user logs in.. the session is set to that user. So say I log in, order something, and hit buy..

 

 

when the user hits buy, it takes the user to paypal, thus leaving my site and destroying the session it seems. Is there anyway I can have it not destroy the session?  Maybe cookies? Because im using paypals IPN to send back information to my site and adding this to a database.

 

Im saying

 

<?php
     if(isset($_SESSION['priv']))
{
   //Retrieve the values being sent like the date, gross cost, and product

   //then, connect to the database, table receipts, and add these values where userID = {$_SESSION[priv]}

}
?>

 

 

As you can tell.. its not going to work if my session is destroyed when it sends to paypal. Any ideas?

Link to comment
Share on other sites

Does it work if you have another page on your site?  It probably has nothing at all to do with paypal.  I hope you realize that the session mechanism requires cookies for this to work.  The session mechanism needs to set a valid cookie for your site on the client, that has the session id in it.  It sounds like the problem is that a cookie is not being set, so when the client returns from paypal, there was no cookie on the client to read.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.