Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    bug 1.5.4 Whoops! Your session has expired.

    I'm getting Whoops! Your session has expired. If I add something to the cart close the browser then come back to the website and try and add something to the cart again.

    Is there a way to stop this from happening?

    Server details:
    Zencart 1.5.4
    MySQL 5.6.24
    5.6.8-1
    Last edited by marcopolo; 14 Jul 2015 at 04:09 AM.

  2. #2
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    Default Re: 1.5.4 Whoops! Your session has expired.

    I fixed the issue! Yesterday I enabled force cookie use under admin/session that was not the issue the last setting: Add period prefix to cookie domain
    was not defined neither the true or false radio button was not selected, so of course I selected true since it says that is the default and that was the cause of my issue. I forgot I did that and after going crazy for a little while I remembered and changed it to false and no more Whoops! Your session has expired. error.

  3. #3
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    Default Re: 1.5.4 Whoops! Your session has expired.

    I do have a question, should I enable the force cookie use? I have it enabled now and does not seem to be effecting anything just want to make sure.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: 1.5.4 Whoops! Your session has expired.

    Quote Originally Posted by marcopolo View Post
    I do have a question, should I enable the force cookie use? I have it enabled now and does not seem to be effecting anything just want to make sure.
    Should use the default settings unless there is an issue that needs to be addressed by changing them... (Sorry doesn't directly answer the question of enable/not enable.)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: 1.5.4 Whoops! Your session has expired.

    I have similar problem.

    In my case I am doing some customization on a local set, and getting the whoops only when I try the add to cart where I customized (messed up ;)), so it should be restricted to this:

    I tried following this thread www.zen-cart.com/showthread.php?43054-Add-Product-to-Cart-URL and added the code in post #8

    Code:
    <form action="http://localhost/zencart_test/index.php?main_page=product_info&amp;cPath=65/&amp;products_id=180/&amp;action=add_product" method="post" enctype="multipart/form-data" name="cart_quantity" id="cart_quantity">
    <input type="hidden" name="cart_quantity" value="1" maxlength="6" size="4" />
    <input type="hidden" name="products_id" value="180" />
    <input name="image" type="image" title=" Add to Cart " src="includes/templates/template_default/buttons/english/button_in_cart.gif" alt="Add to Cart" />
    </form>
    What am I doing wrong?

    Thank you.

    p.s. adding trhu the normal procedure works fine.

  6. #6
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: 1.5.4 Whoops! Your session has expired.

    Haven't included the sessionid into the form option. Assuming that the above is the html added in the product page, should use the ZC form generation function that would take care of that for you... As it is, the added code to the ZC process is designed to fail to prevent rogue cart operation.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: 1.5.4 Whoops! Your session has expired.

    Php function from includes/functions/html_output.php with format as provided at: http://www.zen-cart.com/docs/phpdoc-...utput.php.html : zen_draw_form

    void zen_draw_form( $name, $action, [ $method = 'post'], [ $parameters = ''])
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: 1.5.4 Whoops! Your session has expired.

    Thank you mc12345678

    I understand what you wrote, but don't know what how to do it!
    I mean where do I put
    void zen_draw_form( $name, $action, [ $method = 'post'], [ $parameters = ''])
    and would I just added to the code in my earlier post?

    Though I am sure you got what I am trying to do, please let me detail it more:

    I have a slider where the image would link to the product page, and in the caption section I put the code to add the item to cart directly, and I just added the above code there.

  9. #9
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: 1.5.4 Whoops! Your session has expired.

    Quote Originally Posted by keneso View Post
    Thank you mc12345678

    I understand what you wrote, but don't know what how to do it!
    I mean where do I put
    void zen_draw_form( $name, $action, [ $method = 'post'], [ $parameters = ''])
    and would I just added to the code in my earlier post?

    Though I am sure you got what I am trying to do, please let me detail it more:

    I have a slider where the image would link to the product page, and in the caption section I put the code to add the item to cart directly, and I just added the above code there.
    So if the above is something like this:

    Code:
    <?php //some amount of php
    ?><form action="http://localhost/zencart_test/index.php?main_page=product_info&amp;cPath=65/&amp;products_id=180/&amp;action=add_product" method="post" enctype="multipart/form-data" name="cart_quantity" id="cart_quantity">
    <input type="hidden" name="cart_quantity" value="1" maxlength="6" size="4" />
    <input type="hidden" name="products_id" value="180" />
    <input name="image" type="image" title=" Add to Cart " src="includes/templates/template_default/buttons/english/button_in_cart.gif" alt="Add to Cart" />
    </form><?php // other php stuff
    Then would add the above like so:
    Code:
    <?php //some amount of php that ends at the end of this line;
    
    zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($product_id), 'cPath=' . zen_get_generated_category_path_ids($product_id, 'product') . '&products_id=' . $product_id . '&action=add_product', $request_type), 'post', 'enctype=\"multipart/form-data\" id=\"cart_quantity\"');
    ?><input type="hidden" name="cart_quantity" value="1" maxlength="6" size="4" />
    <input type="hidden" name="products_id" value="180" />
    <input name="image" type="image" title=" Add to Cart " src="includes/templates/template_default/buttons/english/button_in_cart.gif" alt="Add to Cart" />
    </form><?php // other php stuff
    Where $product_id is identified/set to the products_id of the product to which to link... There are other ways to present, but I figured if you have the product_id then the rest should fall in line with the above... Notice that the zen_draw_form is within the php code, not outside in the html code... Not exactly described above about how the html was being generated, so assumed that there is an opportunity to generate the html using php like above..

    If instead you are going to hard code each of these links and not use the php type interface above, then need to include the code that is pushed at the end of the zen_draw_form function...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: 1.5.4 Whoops! Your session has expired.

    Quote Originally Posted by mc12345678 View Post
    Php function from includes/functions/html_output.php with format as provided at: http://www.zen-cart.com/docs/phpdoc-...utput.php.html : zen_draw_form

    void zen_draw_form( $name, $action, [ $method = 'post'], [ $parameters = ''])
    It looks like that docs link needs an update, since the zen_draw_form function returns a string representing the form's <form> tag as well as the hidden input containing the securityToken value if the form's method is "post".

    The OP can make the following change to include the securityToken value:
    Code:
    <form action="http://localhost/zencart_test/index.php?main_page=product_info&amp;cPath=65/&amp;products_id=180/&amp;action=add_product" method="post" enctype="multipart/form-data" name="cart_quantity" id="cart_quantity">
    <?php echo zen_draw_hidden_field ('securityToken', $_SESSION['securityToken']); ?>
    <input type="hidden" name="cart_quantity" value="1" maxlength="6" size="4" />
    <input type="hidden" name="products_id" value="180" />
    <input name="image" type="image" title=" Add to Cart " src="includes/templates/template_default/buttons/english/button_in_cart.gif" alt="Add to Cart" />
    </form>

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v137 Whoops! Your session has expired. Session Question.
    By weblamer in forum Upgrading to 1.5.x
    Replies: 5
    Last Post: 7 Jun 2015, 07:20 PM
  2. v151 Whoops! Your session has expired.
    By Palladium in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 26 Jan 2015, 07:24 PM
  3. v151 Whoops! Your session has expired.
    By kevinangelgonzalez in forum General Questions
    Replies: 6
    Last Post: 12 May 2013, 07:05 PM
  4. Whoops! Your session has expired.
    By charleslumpkin in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 26 Aug 2009, 05:56 AM
  5. Whoops! Your session has expired.
    By YellowStarS2k in forum General Questions
    Replies: 14
    Last Post: 23 Dec 2008, 11:36 AM

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