Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorthu2004
     
    Hi
    Does Akelos support session handling (cookie) ?

    Here is how RoR does http://wiki.rubyonrails.org/rails/pages/sessions

    /Thu
    •  
      CommentAuthorbermi
     

    Hi Thu,

    Welcome to the Akelos PHP Framework forum :)

    Akelos makes use of PHP native support for $_SESSIONS and $_COOKIES and you can use them like:

    $_SESSION['greeting'] = 'Hello world';
    

    parameters in $_SESSION will be added to the controller params attribute, preceding $_POST and $_GET, so you can just use previously stored values on your view like:

    {params-greeting}
    

    or

    {params-greeting?}
    

    You can still use the Request methods Rails has from within your controller like, but the PHP way is quite straight forward and valid

    $this->Request->resetSession();
    $this->Request->getCookies();
    

    Hope you find it helpful,

    Bermi

    • CommentAuthoraekko85
     

    About akelos session, here is what I learned :

    If you want the framework to handle the session, you need to had on the config.php

    define('AK_SESSION_HANDLER', 1);

    Then session will be registered on you database with it's ID, it's expire date and it's data

    Column 'expire' is the time at witch the session was created. Session will expire some time later, that time being set in you php.ini (default 20 mn).

    Column 'value' is a longtext on mySQL, so it can hold a maximum of data depending "on the configured maximum packet size in the client/server protocol and available memory" (cf http://dev.mysql.com/doc/refman/5.0/en/string-type-overview.html) As akelos write many things in the session, that amount can become short if you're putting in a lot of data too. In case of overflow, the transaction will be canceled, so the session will not be changed at all for the whole page.

    Last thing : if you want to maintain alive a session, meaning if you want to refresh the expire date while the user is active on the web site, akelos will handle it for you as long as your session data is changed. It means that if you write the same data in your session, it will not be refreshed. For that purpose, I tend to use time()