Hi All, I am new for development as well as asp; my problem is session’s creation using (parameter). Say for example i have form1.asp <body> Test Suite Email Form: <br /> <form method="get" action="simpleform.asp"> First Name: <input type="text" name="fname" /><br /> Last Name: <input type="text" name="lname" /><br /><br /> <input type="submit" value="Submit" /> </form> form2.asp <% request.querystring("fname") Session("fname")=fname Session.Timeout = 100 Response.Write(Session("fname"))%> and The below set of code is working fine because i am hard coding the values <% Session("fname")="I am Working" Session.Timeout = 100 Response.Write(Session("fname"))%> so could you please help me on this.... Thanks in advance Ashok N
You are not assigning the value from the querystring to a variable. <% Dim strFName strFName = Request.QueryString("fname") Session("fname") = strFName Session.Timeout = 100 Response.Write(Session("fname")) %> Code (markup): Assuming you are using classic asp the above should work... alternatively: <% Session("fname") = Request.QueryString("fname") Session.Timeout = 100 Response.Write(Session("fname"))%> Code (markup):
Yeah your not putting fname into a variable. As it stands: this line here isnt setting fname to a variable, it should be request.querystring("fname") fname = request.querystring("fname") then you put it into your sesison here. Session("fname")=fname
ASP session doesn't work well on Internet Explorer 7. I would recommend to look for an alternative solution (ASP class) to handle sessions properly.
I have used asp session's a lot and have never had a problem with it, whether it is with IE7 (which I use by default) or any other browser.... It is fairly obvious that the problem is with the code.
Sessions work fine with all popular browsers. If it does not work it could be because of your security restrictions set on the cookies by your browser. The browser should be set to accept cookies for the sessions to work.
Correct, if cookies are disabled, you can't set session variables, they will behave like regular variables (when the page is finished, the variable is cleared).