Skip to content

Instantly share code, notes, and snippets.

@UndergroundLabs
Created November 2, 2015 17:45

Revisions

  1. UndergroundLabs created this gist Nov 2, 2015.
    29 changes: 29 additions & 0 deletions UserSessionService.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    <?php

    namespace QuizApp\Services;

    class UserSessionService {

    private $app;
    private $container;

    public function __construct($app, $container)
    {
    $this->app = $app;
    $this->container = $container;
    }

    public function create($fbid, $firstname, $lastname)
    {
    $_SESSION['user'] = array(
    'fbid' => $fbid,
    'firstname' => $firstname,
    'lastname' => $lastname
    );
    }

    public function destroy()
    {
    unset($_SESSION['user']);
    }
    }