T
thecoolone
Im doing a project on Internet Banking.
I have created a login page and im using forms authorization (done in
web.config) and in the login page i have the following code
"FormsAuthentication.SetAuthCookie(user,true);
Response.Redirect("welcome.aspx");"
My problem is that im using a session variable
"Session["name"]=TextBox1.Text;"
to query the database to get details of a particular user.
So even though i have set a persistent cookie, whenever i shutdown and
restart the browser im unable to auto login and check the other pages
without again signing in again coz of the session variable not being
initialized.
So is there a way by which i can enter and retrieve a variable say
"username" from the cookie (i mean the same cookie which is set by
FormsAuthentication.SetAuthCookie) and use that to auto-login and query
the database.
any help is welcomed.
thanx in advance
P.S: Im using C# as the Page language.
I have created a login page and im using forms authorization (done in
web.config) and in the login page i have the following code
"FormsAuthentication.SetAuthCookie(user,true);
Response.Redirect("welcome.aspx");"
My problem is that im using a session variable
"Session["name"]=TextBox1.Text;"
to query the database to get details of a particular user.
So even though i have set a persistent cookie, whenever i shutdown and
restart the browser im unable to auto login and check the other pages
without again signing in again coz of the session variable not being
initialized.
So is there a way by which i can enter and retrieve a variable say
"username" from the cookie (i mean the same cookie which is set by
FormsAuthentication.SetAuthCookie) and use that to auto-login and query
the database.
any help is welcomed.
thanx in advance
P.S: Im using C# as the Page language.