Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default A pretty weird problem while accessing session outside of zen

    I'm trying to access $_SESSION outside of zen, the purpose is to set a certain variable to see if js is enabled or not (the file is placed at zen root folder and called via ajax)

    PHP Code:
        require('includes/application_top.php');
        
        
    sleep(5);
        
        
    $_SESSION['javascript_enabled'] = true;
        
        exit(); 
    You can notice I have to use sleep(5), otherwise the session is still set (when I print_r), but it's not stored at all (when you go to the next page)

    I suspect we have a race condition here? It's weird since I thought php can not work that way.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  2. #2
    Join Date
    Feb 2006
    Location
    New Zealand
    Posts
    28
    Plugin Contributions
    2

    Default Re: A pretty weird problem while accessing session outside of zen

    I would assume it is because application_bottom.php is not included. That, in turn, would call session_close (or similar). My understanding is that that will trigger persisting the session.

    mano

  3. #3
    Join Date
    Feb 2007
    Posts
    3
    Plugin Contributions
    0

    Default Re: A pretty weird problem while accessing session outside of zen

    Thanks mano, i've been bashing my head against the wall about this for a long time.
    If you ever in wgtn, I'll buy you a beer/coffee/preferred liquid refreshment.
    Cheers
    Dave T

 

 

Similar Threads

  1. Accessing DB/Functions Outside the Store?
    By suntower in forum General Questions
    Replies: 1
    Last Post: 4 Aug 2011, 06:15 PM
  2. Replies: 6
    Last Post: 15 Apr 2011, 08:56 PM
  3. accessing cart from pages outside of zencart DIR
    By orzel in forum General Questions
    Replies: 3
    Last Post: 20 Jul 2009, 09:58 PM
  4. My idea for accessing zen cart sessions outside of zen...
    By glenelkins in forum General Questions
    Replies: 25
    Last Post: 2 Oct 2008, 10:57 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