Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2009
    Posts
    86
    Plugin Contributions
    0

    Default Whoops! Your session has expired. when adding to cart from external link

    Hey all, I have a customer that uses a different landing page for some special needs clients, I am using this code on the external page:
    Code:
    <form name="cart_quantity" action="https://mysite.net/index.php?main_page=product_info&amp;action=add_product" method="post" enctype="multipart/form-data">
        <input type="hidden" name="cart_quantity" value="1" />
        <input type="hidden" name="products_id" value="'.$theProductId.'" />
        <input type="submit" value=" ADD TO CART " /><br />
    </form>
    But when click, takes me to the shopping cart page, but displays the:
    Whoops! Your session has expired.

    I have read several posts and nothing is working for me, I also saw a post from Dr Byte talking about a change in ZC 1.5, is there a work around? can i do this?
    Thanks in advance
    Jeff

  2. #2
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Whoops! Your session has expired. when adding to cart from external link

    Be aware "cross-site requests" will be blocked for obvious security reasons. Your "different landing page" will need to reside on the same server / domain (and can then be proxied if needed - or - the multisite modification utilized if branding is required).

    The easiest solution is converting the external "different landing page" to an internal Zen Cart page. This way the "different landing page" has access to Zen Cart's session, functions, and security framework.


    NOTE: The above is based on the very limited information provided by the original poster. If more detailed information is provided, additional solutions may present themselves. In order to provide anything beyond an educated guess, the volunteers on these forums need the original poster to provide: answers to the questions in the "posting tips", URLs to both the landing page and the Zen Cart site, and detailed information regarding the desired end result.
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

  3. #3
    Join Date
    Jun 2009
    Posts
    86
    Plugin Contributions
    0

    Default Re: Whoops! Your session has expired. when adding to cart from external link

    Thank you for the quick response, it is on the same domain, is it possible to use application top outside of the includes dir? when i tired to do that i got a wite page and decided not to peruse it because i though it may have issue.
    Can you use application top outside of includes?

  4. #4
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Whoops! Your session has expired. when adding to cart from external link

    I would not recommend doing so. Instead take a look at how Zen Cart pages are constructed.

    For example the Zen Cart "contact_us" page:
    "/includes/modules/pages/contact_us/header.php" - Business rules and DB queries.
    "/includes/languages/<your langauge>/contact_us.php" - Langauge constants (for your language).
    "/includes/templates/<your template>/templates/tpl_contact_us_default.php" - The HTML template used.

    So if you wanted to create your own page "my_special_landing":
    "/includes/modules/pages/my_special_landing/header.php" - Business rules and DB queries.
    "/includes/languages/<your langauge>/my_special_landing.php" - Langauge constants (for your language).
    "/includes/templates/<your template>/templates/tpl_my_special_landing_default.php" - The HTML template used.
    "/includes/extra_datafiles/my_special_landing.php" - add a FILENAME constant:
    Code:
    <?php
    if (!defined('IS_ADMIN_FLAG')) {
      die('Illegal Access');
    }
    
    define('FILENAME_MY_SPECIAL_LANDING', 'my_special_landing');
    And then the page can be accessed via with a web browser at "/index.php?main_page=my_special_landing". On any internal Zen Cart page you can create a link to this page using "zen_href_link(FILENAME_MY_SPECIAL_LANDING);".


    You then will want to take a look at how the products_info page works (as it contains a form to "buy now" a specific product_id). You will probably need to adjust the DB queries and HTML some, but should hopefully give a viable example...
    Last edited by lhungil; 8 Jun 2015 at 09:15 PM.
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

 

 

Similar Threads

  1. Replies: 7
    Last Post: 25 Feb 2016, 02:55 PM
  2. v154 Whoops! Your session has expired. Just upgraded to 1.5.4 from 1.3.9. Stripe payment m
    By SHtj in forum Built-in Shipping and Payment Modules
    Replies: 6
    Last Post: 20 Aug 2015, 04:00 PM
  3. v153 When try to create new client: Whoops! Your session has expired.
    By etapavirtual in forum General Questions
    Replies: 16
    Last Post: 17 Dec 2014, 09:24 PM
  4. v151 Whoops Your Session Has Expired when using eProcessing Network SIM emulator
    By firstcapitalfirearms in forum General Questions
    Replies: 0
    Last Post: 22 Feb 2013, 07:23 PM
  5. Whoops! Your session has expired. - Returning from Authorize.net
    By flash in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 17 Jul 2008, 06:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR