TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Problem with Sessions
  • Hi to all!

    Trying to add a payment authorization on my store by the following scheme: 1) I send the order data to the bank server. 2) Bank server checks the data and if it's ok it POSTS me transaction data. 3) I check the transaction data and if it's fine, save the order.

    I store the order data in the sessions. When Bank server sends me transaction data, I can't get the stored session keys and values. If I get it like this:

    $session = Session::instance();
    $data = unserialize($session->get('order'));
    // $data is bool FALSE

    Why does it happens? And how to fix it? Thanks in advance!

  • Forgot to say: using Kohana 3.3.1, native session adapter

  • $data =$session->get('order'); - Session auto serialize/unserialize data

  • Ok, @WinterSilence. But the issue still exists

  • @srs, native sessions use cookies. Bank servers might not handle cookies like browsers. Also, you might not sending the cookie when you are sending order data to bank (at stage 1) in the first place.

    I think you must save the order ID in a special temporary orders table in the database, and read back the row when the bank POSTs you back the transaction data (should include order ID).

  • @enov native sessions use cookies?!

  • I ment the Kohana_Session_Native driver. Doesn't it send the session id via cookie?

  • @enov thanks, now understand.

    Most payment systems allow you to send\return the order ID. Do payment after save order in db.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion