0

Basically, in general web application with php we used to check session through calling php script in that particular html page.

But as I am working in Integration of application i.e. Angularjs and Laravel, I m not getting how can I achieve above said thing in this application.

Please guide me for this.

Thanks in Advance.

3
  • Sessions are handled by Laravel automatically. The session data is stored in cookies. It doesn't depend on your JS framework Commented Feb 13, 2017 at 13:04
  • So, if I would like to check that if user logs in or not through session, how can I achieve this? Commented Feb 13, 2017 at 13:07
  • Check my answer Commented Feb 13, 2017 at 13:30

1 Answer 1

1

Sessions are handled by Laravel automatically. The session data is stored in cookies. It doesn't depend on your JS framework

If you want to check if the User has logged in, use this:

if (\Auth::check())
{
    // The user is logged in...
}
Sign up to request clarification or add additional context in comments.

3 Comments

does I need to include any auth file through command promt or Just put the above code? @Paras
If you haven't already included your authentication files, just run php artisan make:auth to generate the login/forget password/reset password/logout views, routes and controllers. Then you may use the code in my post as is anywhere
ok means I just need to generate auth file and then include your code in my controller? Am I RIGHT? @Paras

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.