Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Jun 2011
    Posts
    32
    Plugin Contributions
    0

    Default Check external session before store loads

    Can I check the value of a kohana 2 session variable before zen cart loads? Can I do this in a php prepend file, or should I do this in zen cart?

    Is there anyway to do something like this after calling session start?

    session_write_close();
    session_name($_COOKIE['zenid']);

  2. #2
    Join Date
    Jun 2011
    Posts
    32
    Plugin Contributions
    0

    Default Re: Check external session before zen cart loads

    Accessing the kohana session is no problem. I know how to do that. The issues I'm running into is the cart is empty when I try using a prepend script, and the session persists when I go back to the url if I try doing something in the template header.

    I'm going to try with application_top and see what happens.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Check external session before store loads

    What EXACTLY are you attempting to do here?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Jun 2011
    Posts
    32
    Plugin Contributions
    0

    Default Re: Check external session before store loads

    I want to only allow access to zencart if the user is logged into a kohana script.

    Thanks Dr. Byte. Nice to see you are still around.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Check external session before store loads

    Why not do the inquiry from within Zen Cart? Does your kohana script allow you to inquire whether the visitor is logged in, by making a call from another script, ie: ZC?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Jun 2011
    Posts
    32
    Plugin Contributions
    0

    Default Re: Check external session before store loads

    Something like require('/user/checkStatus') in ZC which returns a variable and avoid sessions altogether?

    Would I create an observer for this or put it into application_top? Thanks

  7. #7
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Check external session before store loads

    It may depend on what you want to happen if you find the "check" returning a response that says the person isn't logged in.
    What do you want ZC to do in that case?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Jun 2011
    Posts
    32
    Plugin Contributions
    0

    Default Re: Check external session before store loads

    Quote Originally Posted by DrByte View Post
    It may depend on what you want to happen if you find the "check" returning a response that says the person isn't logged in.
    What do you want ZC to do in that case?
    I would just like to do a header('Location: /');

  9. #9
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Check external session before store loads

    In that case simply put your custom detection code in /includes/extra_configures/check_kohana.php as there's no need for the complexity of observers.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Jun 2011
    Posts
    32
    Plugin Contributions
    0

    Default Re: Check external session before store loads

    Quote Originally Posted by DrByte View Post
    In that case simply put your custom detection code in /includes/extra_configures/check_kohana.php as there's no need for the complexity of observers.
    Thanks. There are two issues:

    Wouldn't accessing kohana from zencart using require, curl, fopen or file_get_contents start a different session, as the user logs in with the browser and the script uses the server?

    Also is there an issue if authorize.net calls a form_action_url from a cronjob and the kohana session does not exists?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Customer losing session while building options on external site
    By delia in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 16 Aug 2013, 02:31 PM
  2. v150 Check point list before opening store?
    By ninabell in forum General Questions
    Replies: 8
    Last Post: 5 Jul 2012, 07:30 PM
  3. break before checkout_success using external payment module addons
    By FrilansReklam in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 8 Jan 2009, 08:43 PM
  4. Replies: 13
    Last Post: 2 Nov 2008, 11:42 PM

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