I want to maintain the session into html pages but I have problem of finding a way to pass the session variables into html pages. So this is my login.asp code.
<%@Language="JavaScript"%>
<html>
<body>
<%
var Conn=Server.CreateObject("ADODB.Connection");
var DSN="DSN=file";
Conn.Open(DSN);
var Rst=Server.CreateObject("ADODB.Recordset");
var sql = "SELECT nme,userid,userpwd FROM student WHERE userid="+Request.Form("userid")+"AND userpwd='"+Request.Form("userpwd")+"'";
Rst.Open(sql,Conn);
if(!Rst.EOF)
{
var user;
Session("userid")=Rst("userid");
Session("nme")=Rst("nme");
Response.Write("Hi "+Session("nme")+"!. Welcome Back.Good to see you again. Redirect to homepage in 3 seconds");
Response.Write("<br />");
Response.Write("<a href='logout.asp'>Logout</a>");
Response.AddHeader("REFRESH","3;URL=home.htm");
}
else
{
Response.Redirect("login.htm");
}
%>
</body>
</html>