I'm trying to dynamically show a bootstrap alert https://getbootstrap.com/docs/4.3/components/alerts/ that displays a message to accept using cookies once a user clicks the OK button, the alert message should disappear and not show to that user again during that session.
Unfortunately, I can't find a documentation on bootstrap site that allows for programmatic opening of a bootstrap alert. Therefore every-time the website is refreshed, the alert pops up again.
<div class="alert fade show cookie-alert" role="alert" data-dismiss="alert">
<div class="container">
This website stores cookies. These cookies are used to collect information about how you interact with our website, we use this information to improve and customize your browsing experience. Read our <a target="_blank" href="http://assets.investnow.ng/InvestNow_TC.pdf" style="color:gray;font-weight:bold">terms and conditions</a> to learn more.
<button type="button" class="btn btn-danger btn-sm pull-right cookie-btn okbtn" data-dismiss="alert" aria-label="Close">OK</button>
</div>
</div>