In Global.asa file session variable is set in Session_OnStart like
session("username")=""
When the application is called session variable is set like session("username") = "Alex" and test.asp page is loaded. But when I am clicking on any link on the test.asp page I am getting the same page i.e test.asp. I checked the code and found out that the session
variable is set to null thats why it is calling the same page. But when the second time you click any page I am able to get the correct page.
As far as I know once the session variable is set it will remain until the user log offs.
Please can any body tell me why session variable is getting null value.
I am updating a table depending on the user input that could be left blank for the numeric as well as the string field. I am getting an error if I do the following:
Dim a = null
sql = "update country set number =" & a
If I do ... sql = "update country set number = null", it works fine.
How can I use the variable to change the value to null.
I have an interesting situation that needs to be addressed ASAP.
I am running a standard SQL Query in ASP to retrieve some rows/columns from a table that's on a SQL Server 2000 database. I put the results of that query into a RecordSet, and then use the GetRows function to push the results that are in the recordset into an array variable. In the query that I am running, 39 columns and 2 rows are returned.
The GetRows function appears to be working - the array variable is being created with the proper dimensions. However, the values of the different "cells" of the array are not showing up correctly. The first and the last column values for each row are correct, yet everything else in between is blank, empty, NULL, or whatever.
In other words: ArrayVariable(0,0) shows up correctly, ArrayVariable(38,0) shows up correctly, but everything in between is null.
I did a test on the RecordSet and discovered that it was the culprit - it wasn't being filled in properly. This is strange, though, because the select query that I run in the ASP code to create the recordset returns perfect results when I run it on the SQL Server 2K database.
I delete the files/cookies and clear history from the IE 6.0 browser and try to write in a text file use FSO but it dont write any thing in the file needs Code:
I'm trying to set a session variable after displaying a form, then capture the Session variable on postback. For some reason, the below code always returns the form, not the "Step 2" results part. What am I doing wrong? It's on a local network server, not on the web if that matters.
<% '* Step 2: Display results '********************************************** If Session("PageAction") = "view2" Then Response.Write "Results"
'* Step 1: Display form '**********************************************
I have created a session variable.... and i have to write code to check for this session for each ASP webpage in my website....Is there a alternative I do not want to repeat the same code for valid session.... in each page..
I first create a session variable 'client' in the login.asp file The login.asp file opens a file (xxx.asp) with an include file If I write <!--#include file="../../../data/" & session("client") & "/language_ger.inc"--> I have a message stating that the application can't find the file.
If I write the path without the variable (" & session("client") & ") <!--#include file="../../../data/eurovini/language_ger.inc"--> it works without any problem.
Question - is there is an error in the syntax? - is it possible to include this kind of variable in an include file. And if not, any idea to get the same result?
I'm new and I hope I explain this correctly.I have a products page which populate products dynamically with checkboxes. when the form is submitted, I check for selected boxes using the split(). My problem is, products page submits the form to client.asp, and within that page is client info. then the client page is submitted to confirmOrders.asp, which will display client info, and products selected. the split() works fine within the client.asp page. I'm trying to assign the checkboxs to a Session variable and use it on confirmOrder.asp. Then display the session variable on confirmOrders.asp page. I know I can do everything in one shot with confirmOrders.asp, but the client wants to display the client.asp page then the latter. hmm...hope this makes sense.
Is there a simple way to store session variable on the client-side javascript or retrieve the value of the session variable from the server-side session("variable") script onto the client-side script? I want to keep the value of user entry on the text field of an html form after refreshing.
The value of session variable is shown and the timeout value (60) shown as well. But immediately I get the error message "a timeout has been occurred, you have to log in again". If I make the highlighted sentence comment then I don't get the error.
Has somebody an idea why I receive immediately the timeout error?
A user field called 'Custom1' exists in my data base. This user field is used to hold a URL path to a custom download page for clients. Each client has their own unique URL which directs them to specific locations.What would the proper format be for the variable:
=Session("Cutstom1")
to be able to be displayed as a hyperlink with the label: "DOWNLOADS" while at the same time sending the current user to the 'value' / 'path' to which the Custom1 field contains? I am not an advanced coder and am just starting out with basics.
I assume that mostly,asp programmers use their own session variable to know whether a user is to be considered is-logged-on(together with a home-written log-on form web page).
However, I wonder if there is a convention for the name of such a variable?And does asp/iis have a built-in is-logged-on status variable? For example when IIS is to render a normal html page with an acl that invokes a basic authentication, can I as an asp programmer make use of that status variable, and can I write to it to force a logout programatically?
So, this is not about it there is a session as such, it is about beeing logge-on inside an asp-session. I've looked around but haven't found any good info on this.
I have drop down for selection of council - it is then passed to a session variable - it works fine to display the variable, but when I put it into a hidden field, if the value was Milwaukee it is fine, but if the value was Green Hills, it only puts Green in the hidden field. How can I fix this - I need it to put Green Hills in the hidden field.
when a session variable is declared,how long does that variable last?this isn't coming out of the global.asa.i'm pulling a field out of a db and declaring it with session(whatever)=whatever and then calling it out on the page.
i don't know where else to go, if there is a better or more appropriate forum for this question please let me know.
I have just moved to another isp host and some of my pages use session variables. I have a session variable, amongst others that hold the username and customer number to display data. The session variable value keeps disappearing giving me ADODB.Fielderror '800a0bcd' errors.
If i hot the refresh button a few times the session variable data comes back. Somebody please tell me they've experienced this 'cos i'm losing my mind ! I've updated the page to show the variable, and it does and i've removed underscores from filenames (apparently a possible problem with IIS 6)
i'm using the dundas freelib upload code to upload files in my website. when the user choses to upload a file a new window is opened and the upload procedure goes fine and the file is uploaded successfully. but the problem is the i want to know the name of the file in the parent window to save it in the database.
i tried to use a session variable which contains the name of the file but it dosen't work. the parent window contains a form which is used to insert new data in the database so i can't use the upload window to insert the filename in the database.
i don't know how to retreive the session variable from the previious page..i have also problem querystring application because the browser execute very slowly..and sometimes page will not be displayed.
I need to create an array with a session variable. According to my book, the following should work,. but if fails
for each key in request.QueryString if left(key,6) = "cboRun" then iIndex = cint(mid (key,7)) response.Write(iIndex & "<br>") session.Contents("iRunNo")(iIndex)=iIndex end if next
it is the (iIndex) part which fails. If I remove this, then I can create a single session variable.
on other page i get username from session variable as follow.
Code:
username = session("username")
this workes fine when i run it on the same PC that is hosting my page(on which IIS is running)..however problem arises when i request page through different PC in the LAN.Nothing is assigned to variable username.
Can I prevent session varaible shared by the new opened browser? For example, if the user has login and viewing a page, when he opens another browser, the user has to login again if he want to veiw the same page in the new browser.
First, I like to know if I can specify how long a session variable could expire?
I am having problem with user logged in period when using session variable.
When I logged in and go away from keyboard for like 10mins. By then I have to login again in order to post or any website features that requires login.
I have not yet create a cookie for the user when they are login.
Im trying to pass the 'month' variable which is a session variable from one page to another. It manage to appear on the other page in a textbox but when I try to pass it to the recordset, it fails. Can I know why?? This is the page which I'm passing the variable to. Code:
I was wondering if there is a way to "trim" the session value in ASP. I know that "trim" takes the spaces but what I want is to shorten the actual txt. For Example I have a Session.MM_Username.
This session return the users email address because I am using this as there username for when they log in. Is is possible to only return the characters before the "@" symbol? when they log in I want the user to see "Welcome abc" not see their email address .
I'm unable to update a session variable btween pages. I can read them after I set in global.asa and I can change its value within the same script but when I go to another page, the session variable remains unchanged.
Does anyone know how to update a session variable to the database.
I can get the session variable to appear on the screen but I can't seem to get it to be send to the database using a form and hidden fields. Does anyone know how to go about this. What do I need to do to maken it work. I'm using ASP/ VBScript & an access database.
I have a declared a session variable array. I want to create an array in my client side vbscript with the same values. I know you can set an array in server side script equal to the session variable array.
Ex. AryDocCache() = Session("DocCache")
How do you set an array in client side script equal to the session variable array?
I know this does not work. AryDocCache()= <%=Session ("DocCache")%>
I have a form submission page that I am using some session variables that are created on the page in order to keep track of the information that they have already inputted - so when they click submit if there are any errors the fields that are correct remain populated.However, I am wondering is there a way that if they navigate away from this one page all the session variables that are created are removed so if they come back to the page they need to re-enter the information?
Something like "on page exit - remove session("name")..." ?
I have an ecommerce site that works okay. My problem is that at the point where credit cards are put in I get an unique ID from the database which gets put into a session variable and then the user goes through makes the transaction and all is well.
The problem comes where if the browser isn't shut down you can go through the shopping process again but the session variable stays the same and this is causing me concern.
What I want to do is if the person leaves the site then the session variable is destroyed. Is there a line of code that can do such a thing or am I being simplistic in my approch?
Right I have created a web login and set one of the results to become "pluser" session varible. What I now need to do is use this varible in DRW so that when the user goes to pages with databases it automaticly returns values for that varible. Code:
I keep reading that Session variables are evil things to be avoided. Is it really that awful to use them? If you shouldn't use them, then what is the preferred alternate method for accessing data across an entire solution? Would it really be so bad to set something as simple as Session("login") = true Session(user)=username when a user logs in and just read those variables on an include for every page to display the user name?
Is it true that a user has to allow cookies in order for a session variable to be used? I thought the point of session variables was to set things on the server side so that you didn't have to worry about cookies being allowed by the user?
What is the generally preferred method of storing a shopping cart? Database, cookies or server variables? All I need to save is the product # and quantity. Would it be evil to store that in a dictionary object or a collection? My profs at the college said cookies were the way to go. My co-workers say use a database. My mentor says use a dictionary object.
I've a problem with trying to retrieve a session variable in an include file.
Basically, the main asp creates a session variable:
<% Session("var1") = "Hello" %>
And then when I click on a button it refers to the include file, which I believe is all client-side code as there are no server <% %> tags.
I want to be able to use this session variable in the include file, how do I do this?
If I try retrieving this session variable with Session("var"), it will come up with an error saying that it has a type mismatch 'Session'.
The session state is enabled in IIS manager and appears to be working with the other session variables in asp's not written with the server tags <% %>.
The include file has the .asp extension and has two language sections and I want to use the session variable within the vbscript language tag like this: Code: