brefphp / bref

Serverless PHP on AWS Lambda
https://bref.sh
MIT License
3.11k stars 366 forks source link

Document using sessions via DynamoDB #438

Open mnapoli opened 5 years ago

mnapoli commented 5 years ago

There is this great article on using DynamoDB for storing PHP sessions: https://medium.com/five-words/simple-session-handling-for-load-balanced-php-applications-494cfb3aa6e7

I think we can simplify some steps in Bref, and we could document it. Not sure if this would be the best way to do when using a PHP framework though 🤔

aknosis commented 5 years ago

I implemented sessions in a bref http project with the steps noted in that post. There really isn't much to it, you enable it and it just works.

What steps do you think bref could simplify though? To me it seems like this would be a documentation / suggested use case but really not anything bref should be in charge of.

mnapoli commented 5 years ago

That's good to know thanks. Maybe just a documentation could be enough. I haven't needed this I usually use a framework.

What we should document should address Symfony, Laravel and the "no framework" cases.

jasonmccallister commented 4 years ago

AWS has a nice write up on their docs for using DynamoDB with PHP session that might be helpful: https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/service_dynamodb-session-handler.html

pmayet commented 4 years ago

@mnapoli I can document with Laravel. Do you want that I make a PR in brefphp/examples ?

mnapoli commented 4 years ago

@mnapoli I can document with Laravel. Do you want that I make a PR in brefphp/examples ?

Yes that would be great!

pmayet commented 4 years ago

@mnapoli Done with PR https://github.com/brefphp/examples/pull/11