Hi, need some help here with sessions...
I'm facing some problem using session for my login page for my web application...
In other pages, I don't have any problem and I'm not sure why.
What is supposed to happen:
1. User Logs in (secure/login.aspx)
User id is stored as in session object
2. User redirected to account details (admin/acct.aspx)
User id is retrieved from session object and printed using response.write
Below shows part of the code i've used:
In login.aspx:
Code:
FormsAuthentication.SetAuthCookie(Me.txtbox_LoginID.Text, False)
Session.Add("LoginID", Me.txtbox_LoginID.Text)
Response.Redirect("../admin/acct.aspx")
In acct.aspx:
Code:
response.write(Session("LoginID"))
Problem: The Login ID is not printed! I did a step through of the code and the count for number of items stored in session = 0 when it should be 1!
I've used the above methods for other pages to store other types of values and they all work. But for this particular login page, it just does not work!
Any help is greatly appreciated!
Thanks.
Scripts82