panique / mini

Just an extremely simple naked PHP application, useful for small projects and quick prototypes. Some might call it a micro framework :)
1.35k stars 478 forks source link

How to check user is logged in or not in the actions? #221

Closed rsmmukesh closed 8 years ago

rsmmukesh commented 8 years ago

How to check user is logged in or not in the actions? do i need to check session exist value for each action? or do we have any other easy way? suppose i have so many actions that user can access only if logged in. (In .Net MVC we can use attribute like that )

panique commented 8 years ago

That for sure depends on what exactly you want to do. MINI is not made for user authentication, maybe HUGE (https://github.com/panique/huge) is a better fit for you! I would split in the application in controllers that are totally public to everybody, and controllers that are only useable for authenticated users, maybe by asking for authentication in the controller constructor or so...