How do I display a message after a user registers or when he hasn't logged in yet?
<p>I'm a beginner. I want to know how to display an alert message after user registers. After displaying the message, it should redirect to index page. </p>

<p>And, when the user(who hasn't logged in), clicks a link, it should display an alert message:- You must login first.</p>
