flightphp / core

An extensible micro-framework for PHP
https://docs.flightphp.com
MIT License
2.63k stars 408 forks source link

Session in flight #106

Closed frankmaniaz closed 10 years ago

frankmaniaz commented 10 years ago

As flight sessions start in php?

mikecao commented 10 years ago

Flight does not do anything with PHP sessions. You'll have to handle it yourself.

Conver commented 9 years ago

Is it planned to include session and/or cookies handling in Flight?

would be very great if so.

jimlei commented 9 years ago

Afaik Flight is so minimalistic it would advise to include some other session handler. There are quite a few available through packagist.

If you want a more complete framework out of the box there are multiple levels "up" from the bare bones of Flight. Slim is kind of a Flight+session+flash messages+logging, Silex is similar (a micro-Symfony) and in the entire other end you have Laravel/Symfony that are quite huge Frameworks including "everything".

Conver commented 9 years ago

@jimlei I know about the other frameworks :) but I love Flight, and what all my apps are coded in.

Since cookies or sessions are something almost every app uses, it would be a good idea to include it in Flight, just me thoughts.

jimlei commented 9 years ago

@mikecao would you consider a PR for Flight::session()?

mikecao commented 9 years ago

@jimlei I'd have to think about the session support. When using native PHP session things can get really messy and you have to figure out how the user's environment is configured. Even Slim doesn't support native sessions. Writing to $_SESSION is easy enough, but you have to make sure session_start is called at the right time. Cookie support I think should be doable though.