Drupal 8: check user is logged in or not in *.html.twig

In the new era the drupal8 twig is introduce, so old basic php drupal hook is not useful in theme templates. Now twig is power under the template and if you want to know the user is logged in or Not you can use the following method in your template like node.html.twig or html.html.twig or page.html.twig etc 

{% if logged_in %}
 !!!! do you stuff !!!
{% else %}
 !!!! do you stuff !!!
{% endif %}

Its Just a simple thing helps to add script, or your static html or dynamic coding 

Happy Coding, Have Fun

Create a Flag link programmatically and render flag link in twig template drupal 8

This article is refer to generate the flag link programmatically and render in drupal 8 twig template, before in drupal 7 its was quiet easy to render or generate flag link in just a single line of code. see below 

drupal 7 :

<?php flag_create_link('bookmarks', $node->nid); ?>

But In drupal 8 twig is comes in picture so to do in that we have to one extra step, see below 

Drupal 8: