Brandon
Brandon

Reputation: 13

Zend 2 Storing value in session

I've been trying to save a value to the session for over an hour now. The zend documentation is too confusing. They reference SessionManager, Session Container, Session save handlers, Session storage, Session validators.

I just want to store something to session and use it in another controller. but Zend makes it so difficult to do just that.

Any help is appreciated.

Upvotes: 1

Views: 438

Answers (1)

user3040610
user3040610

Reputation: 760

You can use session container to save sessions.

use Zend\Session\Container;

public function indexAction()
    {
        $session = new Container('sessionsample');
        $session->offsetSet('id',1);
    }

Upvotes: 1

Related Questions