Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorupupnaway
     
    I'm just looking for some info on how to go about setting up sessions in Akelos.

    How do you set up database stored sessions? Do i define it in my config?
    •  
      CommentAuthorbermi
     

    Using sessions in Akelos is as simple as simple as using PHP $_SESSION

    If you want to use store sessions on the database you need a sessions table. You might already have such table it if you used the web installer otherwise you can use this migration

    class DatabaseSessionsInstaller extends AkInstaller
    {
        function up_1()
        {                
            $this->createTable('sessions', '
            id string(32) not null primary key,
            expire datetime,
            value text'
            , array('timestamp'=>false));
        }
    
        function down_1()
        {
            $this->dropTable('sessions');
        }
    }
    

    once you have a sessions table you need to tell Akelos you want to use the database session handler by defining in your config/config.php

    define('AK_SESSION_HANDLER', 1);