Thread: session
View Single Post
  #1 (permalink)  
Old July 18th, 2006, 04:58 AM
lakshmi devi lakshmi devi is offline
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default session

hi,

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.

textboxes are in default.htm page.


thanks in advance






Reply With Quote