lundi 12 août 2019

If session through includes?

first sry for my english.

I got 3 files: index.php / header.php and footer.php

I want the session go ahead of header.php

index.php

<?php include("header.php"); ?>
Some Data inside index.php
<?php include("footer.php"); ?>

header.php

<?php if(session('access_token')) { ?>

footer.php

<?php } ?>

how can I make this method gonna work? I need the session start on header.php but dont wanna close him there!

Aucun commentaire:

Enregistrer un commentaire