Session Variables in IIS

B

Brian Brinks

I am having some trouble with seesion variables.

I have just moved hosting companies to Brinkster.com but have been
having problems with my applications holding session.

They say they can't guarantee sessions and recomend another method of
storing persistant data.

I questioned them on why, only on their servers, my sessions are being
reset as often as they are. They said it must be a coding issue.
However, I have not had trouble before, with same applications on
different or local servers.

So my question is this, what can reset session data? Just a reset of
iis?
 
E

Evertjan.

Brian Brinks wrote on 22 sep 2005 in
microsoft.public.inetserver.asp.general:
I am having some trouble with seesion variables.

I have just moved hosting companies to Brinkster.com but have been
having problems with my applications holding session.

They say they can't guarantee sessions and recomend another method of
storing persistant data.

I questioned them on why, only on their servers, my sessions are being
reset as often as they are. They said it must be a coding issue.
However, I have not had trouble before, with same applications on
different or local servers.

So my question is this, what can reset session data? Just a reset of
iis?

Please show us the smallest code where this phenomenon happens.
 
B

Brian Brinks

Here is a code sample - It is basically very simple - just gettin some
data from a db and displaying it in a dropdown:

Function displayCompanies()
dim arrCompanies,i
arrCompanies = DB_ExecuteSQLReturnArray("SELECT * FROM t_company order
by t_company.company")
if ISarray(arrCompanies) = TRUE then
%><div align=center>
<form name="companyidd" method="post"
action="home.asp?action=companydata">
<select name="select"
onchange="window.open(this.options[this.selectedIndex].value,'_top')">
<option>Companies</option>
<option>-----------------------</option>
<%
for i=0 to ubound(arrCompanies,2)
%><option
value="home.asp?action=companydata&cid=<%=arrCompanies(0,i)%>"><%=arrCompanies(1,i)%></option><%
next
%>
</select><br>
<br>
<!--<input type="submit" name="Submit" value="Submit">-->
</form></div><%
end if
end function
 
E

Egbert Nierop \(MVP for IIS\)

Brian Brinks said:
I am having some trouble with seesion variables.

I have just moved hosting companies to Brinkster.com but have been
having problems with my applications holding session.

That's true. If an application is reset or if you are using a web farm you
can't garantuee your session.
Happily, there are good products such as below to solve this.
ISP Session is one of the best compatible with asp and asp.net (version 5.2
is being built to allow even better integration with .NET)
 
E

Evertjan.

Brian Brinks wrote on 22 sep 2005 in
microsoft.public.inetserver.asp.general:
Here is a code sample - It is basically very simple - just gettin some
data from a db and displaying it in a dropdown:

Function displayCompanies()
dim arrCompanies,i
arrCompanies = DB_ExecuteSQLReturnArray("SELECT * FROM t_company
order
by t_company.company")
if ISarray(arrCompanies) = TRUE then
%><div align=center>
<form name="companyidd" method="post"
action="home.asp?action=companydata">
<select name="select"
onchange="window.open(this.options[this.selectedIndex].value,'_top')">
<option>Companies</option>
<option>-----------------------</option>
<%
for i=0 to ubound(arrCompanies,2)
%><option
value="home.asp?action=companydata&cid=<%=arrCompanies(0,i)%>"><%=arrCo
mpanies(1,i)%></option><%
next
%>
</select><br>
<br>
<!--<input type="submit" name="Submit" value="Submit">-->
</form></div><%
end if
end function

You are not quoting your question, but I suppose you lost your session
variable?

I do not see a session variable in your code.
 
E

Egbert Nierop \(MVP for IIS\)

Hi Brian,


Did somebody configure IIS on Win2003 to utilize a web garden? If so, this
is logical. You can't share sessions among a wegb garden without jumping to
external tools since MS does not support sessions for that purpose.
 
P

Prabhat

Hi,

I have one small question on Session. How do I know from which link my
webpage is clicked (like is that from Google ot from with in the same main
page).

I know about Request.ServerVariables("HTTP_REFERER"). So I used this in
"global.asa" file in "Session_OnStart" event like this:

Sub Session_OnStart
Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
End Sub

Sub Session_OnEnd
Session("ReferralURL") = ""
End Sub

So that I can use the session variable any where in my website, because the
HTTP_REFERER will give the URL of the last webpage.

But this seems to not working.

Thanks
PN
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top