4 Replies Latest reply on Aug 25, 2008 3:07 AM by mrcharis2003@yahoo.c

    Orders Management and session problem

      Im trying to adapt the Orders Management tutorial for use as an event registration tool. I have everything working but I have discovered a problem with the use of sessions. The tutorial uses session_id() as a unique key in the order acknowledgement and order delete e-mails. My problem is Safari (didnt test in other browsers) must be quit before a new session_id is generated. That means after I get my acknowledgement/delete e-mail I can go back to my site, submit another RSVP (order) and the same session_id will be used and set for that order. This means I have duplicated keys in my rows. In addition, when I acknowledge an order it will set all orders to status 3. Also, delete will delete only files in the order_ord table (the one with the sesid_ord field) and will leave files in the order_product table. That is, a row with a different order id will not be deleted.

      Im trying to get a unique session_id without quitting the browser itself or find another solution mentioned in the tutorial, see below.

      I tried messing around with sessions, but Im kind of a newbie and was not successful. I tried using these to replace session_unregister('kt_order_id') in the complete_order pages Custom Trigger:

      session_destroy(), this generated an error with the e-mail Trigger

      session_regenerate_id(TRUE), this did reset my session_id but I couldnt find a way to grab the new session_id. I think this might work but I dont know how ADDT uses session_start(), I think you have to call KT_session_start() but Im not sure where to use it.

      unset($_SESSION['kt_order_id']), I get duplicates with this, too

      In the tutorial, I see this:
      One solution is to use a new table column to store a unique random key that is generated with the mail sending, and to delete it once the operation is finished.

      This would solve the problem but I dont know how to grab the email random key. Manual says:
      kt_login_random - stores the random key generated upon registration. It is available only when using account activation with random key.

      Can anyone give me a clue on how to solve the problem that would be great?

      You can view the tutorial here: http://www.interaktonline.com/Documentation/MXKollection/mx_kollection.htm#078000_tutoria lordersmgmt.htm

      Alternatively, go here: http://www.interaktonline.com/files/docs/MXKollection/Tutorial%20-%20Orders%20Management% 20Intranet.pdf

      Im using:
      Linux, Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.7a mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/ mod_jk/1.2.25 PHP/5.2.5 mod_perl/2.0.3 Perl/v5.8.8, MySQL 4.1.22
        • 1. Re: Orders Management and session problem
          DdoubleU Level 1
          I found a solution on my own. Here it is.

          I created a Custom Trigger in the complete_order.php page.

          Put in the trigger:


          Set trigger to AFTER, 50 will work.

          The important thing here is that after a session_regenerate you have to issue a session_start in order to capture the new session_id.

          Now a person can keep their webpage open, logged in and submit order after order and each order will have a new unique session idno more duplicates.

          Hope this saves others some time.

          Best, regards
          • 2. Re: Orders Management and session problem
            mrcharis2003@yahoo.c Level 1
            Hi there......

            I have been following the same tutorial..... is really good and was very hard to find.....

            just a quick question...

            well....maybe two....

            have youfinished the tutorial and does it work good?


            Do you know where I can download the sample zip files needed to complete the tutorial?

            I have been creating all the files and database tables necesary .... but if something goes wrong I would like to have the 100%working sample files.... cant find them anywhere.... they mention them in the tutorial but no link.....

            Anyway good luck with it all.....

            Have a great day
            • 3. Re: Orders Management and session problem
              DdoubleU Level 1
              Heres the pdf: http://www.interaktonline.com/files/docs/MXKollection/Tutorial%20-%20Orders%20Management% 20Intranet.pdf

              Heres online: http://www.interaktonline.com/Documentation/MXKollection/mx_kollection.htm#078000_tutoria lordersmgmt.htm

              Here are all the tutorials files: http://www.interaktonline.com/Products/Bundles/MXKommerce/Documentation/

              I could not find any working sample of the tutorial.

              I have modified the Orders Management application into an Event RSVP application. After many weeks I have it ready for debug, it seems to be working find. I modified the backend to make it possible for the administrator to add and delete orders. This will also update the Quantity, either adding or deleting to the number of seats available for each event. I addition to an email link for RSVP confirmation I added a link to an online page listing their RSVP components with a cancel function.

              Best of luck
              • 4. Re: Orders Management and session problem
                mrcharis2003@yahoo.c Level 1
                Thanks for your reply
                I will check it out and try to get it up and running asap

                Have a nice day