Skip to content

Instantly share code, notes, and snippets.

@davidverhage
Created August 19, 2015 20:48
Show Gist options
  • Save davidverhage/9b354e76c484682a5542 to your computer and use it in GitHub Desktop.
Save davidverhage/9b354e76c484682a5542 to your computer and use it in GitHub Desktop.
Bootstrap cookie Workaround (workout)
<?php
/**
* Ever needed a modal message displayed only once for every 'new' visitor?
* Title: Bootstrap using cookies to show modal once
*/
if (!isset($_COOKIE['notifica-modal'])){
setcookie("notifica-modal", "true", time()+86400, "/");
?>
<script type="text/javascript">
$(window).load(function(){
$('#notifica-modal').modal('show');
});
</script>
<?php } ? >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment