SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Northwest Florida
    0 Post(s)
    0 Thread(s)
    Hi All,

    First, I'm new to PHP4 but very experienced with Perl and e-commerce development.

    Typically, when someone adds/views their shopping cart or checks out this is done through SSL. All other features of the site including the product catalog script are not secure. I found that if you set your cookie on the non-SSL side then try to read it on the SSL side couldn't be done since they are treated as two different domains.

    I was reading that PHP sessions use cookies. What I'm trying to do is avoid cookies becuase of the above listed problem. Is it possible to handle all of the cart functions on the non secure site and when the user checks out through SSL have it just pick up the data in the session file?


  2. #2
    SitePoint Zealot moshe_be's Avatar
    Join Date
    Dec 2000
    0 Post(s)
    0 Thread(s)
    You would have to tell PHP on php.ini not to use cookies and add sessionID to all your links.

    such as
    <a href="newproduct.php?s=<?=$PHPSESSIONID?>...">

    This will add the session ID to the links, but since if another person uses the link previous buyer gave him he will get the same session - use a table to track sessions with IP address.

    If its not same IP and sessionID then start a new session.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts