Hi I am implementing a chat/inbox feature on my website. When users are not logged in and receive a message from another user, the website will send an email to the recipient of the message. However when the user is logged in it won't.
My questions is how do I tell whether a user is logged in or not? For example, if a user is logged in and then closes the browser my backend wouldn't know anything.
Btw I'm building a Angularjs SPA with a restful API in Laravel 4.?
if you are using build-in Laravel Auth:
if(Auth::check())
{
//do something
}
if you are using Sentry:
if(Sentry::check())
{
//do something
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With