Classic ASP BasicsFor beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
i am new to ASP.my problem is when i create session. the value in the session is expired soon.session value is null in all the pages.this is my code
where i am validating the values entered in the textbox
dim con
set con=server.CreateObject("ADODB.Connection")
con.open strDB '' connectionstring
dim uname,pwd
uname=Request.Form("txtuser")
pwd=Request.Form("txtpwd")
Response.Write(uname&" <br>" & pwd & "<br>")
dim rs
set rs=Server.CreateObject("ADODB.Recordset")
rs.open con.Execute("Select * from Adminlogin where A_Username='"&trim(uname)&"' and A_pwd='"&trim(pwd)&"' ")
if rs.EOF then
Response.Write("Invaid Login Details")
else
Session("LoggedInUser") =rs("A_Username")
Response.Redirect("Admin Control Panel.asp")
end if '' end if of rs record set
this is another page's code
If Session("LoggedInUser") = "" Then
Response.Redirect("../default.htm")
End If
session value is always null in this page.
if rs.EOF then
Response.Write("Invaid Login Details")
else
Session("LoggedInUser") =rs("A_Username")
response.write (rs("A_Username"))
response.write (Session("LoggedInUser"))
response.end
Response.Redirect("Admin Control Panel.asp")
end if '' end if of rs record set