473,387 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

session variables

I think I have figured out my problem but I don't know how to solve it. We
are going to start using a forums package and do not want our users to have
to login to both our site, and then again to the forums package. The
creator of the forums package provides what seems to be an easy workaround
for this. Create two session variables, one for ID, the other for Password,
and his program will take care of the rest.

I have all of my forums package off the root of the drive that has my
Inetpub directory, and within my IIS settings have a virtual directory
pointing to the actual folder. I'm wondering that since my actual forums
folder is outside my IIS, or if its a virtual directors my Session Variables
are not being picked up. I also wonder this for the following reason. On
all of my pages I have

<% If Session("LoggedIn")= "Proceed" Then
Else
Server.Transfer "LoginReturning.asp"
End If
%>

which keeps people from bookmarking and coming back in without logining back
in to the site. However on the forums default.asp page this does not work,
which leads me to believe once again it's a placement issue on my hardrive
with my folders. If I am wrong in my assumptions, and I can do this, how
would I pass the session variable to my default.asp page in my forums
folder? Here is the page that does the checking of my login verification:

<%
Option Explicit
Dim strConnect
%>
<!-- #Include File="Data.asp" -->
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<%

Dim objconn, objrs
Dim lcsql, strName, strEmail, strPassword, Trial, Expiredate,
strCookie2

Set objconn = Server.CreateObject("ADODB.Connection")
Set objrs=Server.CreateObject("ADODB.Recordset")
objconn.open strConnect

Trial = Date

strEmail = request.form("Email")
strPassword = request.form("password")

lcsql="select * FROM results WHERE Email =
'"+request.form("Email")+"' and password = '"+request.form("password")+"'"
objrs.Open lcsql,objconn,0,1,1

'No records returned because user not found

If objrs.EOF then
%>
<Script Language=VBscript>
ReturnItem = msgbox( "Either your name or password was
incorrect, try again.", vbOKOnly, "INCORRECT ENTRY")
</Script>
<%
Server.Transfer "LoginReturning.asp"

else
Session("LoggedIn") = "Proceed"

'The next two session vars are for the forums page
Session("USER") = request.form("Email")
Session("PASSWORD") = request.form("password")
'Check to see that Session variables were indeed assigned
response.write Session("PASSWORD")
response.write Session ("USER")
Server.Transfer "Index.asp"
end if
objrs.Close
objconn.Close
%>

</body>

</html>

Terry
Nov 5 '06 #1
5 1654

"Terry On Windigo" <te***@windigo.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
I think I have figured out my problem but I don't know how to solve it.
We
are going to start using a forums package and do not want our users to
have
to login to both our site, and then again to the forums package. The
creator of the forums package provides what seems to be an easy workaround
for this. Create two session variables, one for ID, the other for
Password,
and his program will take care of the rest.

I have all of my forums package off the root of the drive that has my
Inetpub directory, and within my IIS settings have a virtual directory
pointing to the actual folder. I'm wondering that since my actual forums
folder is outside my IIS, or if its a virtual directors my Session
Variables
are not being picked up. I also wonder this for the following reason. On
all of my pages I have

<% If Session("LoggedIn")= "Proceed" Then
Else
Server.Transfer "LoginReturning.asp"
End If
%>

which keeps people from bookmarking and coming back in without logining
back
in to the site. However on the forums default.asp page this does not
work,
which leads me to believe once again it's a placement issue on my hardrive
with my folders. If I am wrong in my assumptions, and I can do this, how
would I pass the session variable to my default.asp page in my forums
folder? Here is the page that does the checking of my login verification:

<%
Option Explicit
Dim strConnect
%>
<!-- #Include File="Data.asp" -->
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<%

Dim objconn, objrs
Dim lcsql, strName, strEmail, strPassword, Trial, Expiredate,
strCookie2

Set objconn = Server.CreateObject("ADODB.Connection")
Set objrs=Server.CreateObject("ADODB.Recordset")
objconn.open strConnect

Trial = Date

strEmail = request.form("Email")
strPassword = request.form("password")

lcsql="select * FROM results WHERE Email =
'"+request.form("Email")+"' and password = '"+request.form("password")+"'"
objrs.Open lcsql,objconn,0,1,1

'No records returned because user not found

If objrs.EOF then
%>
<Script Language=VBscript>
ReturnItem = msgbox( "Either your name or password
was
incorrect, try again.", vbOKOnly, "INCORRECT ENTRY")
</Script>
<%
Server.Transfer "LoginReturning.asp"

else
Session("LoggedIn") = "Proceed"

'The next two session vars are for the forums page
Session("USER") = request.form("Email")
Session("PASSWORD") = request.form("password")
'Check to see that Session variables were indeed assigned
response.write Session("PASSWORD")
response.write Session ("USER")
Server.Transfer "Index.asp"
end if
objrs.Close
objconn.Close
%>

</body>

</html>

Terry
It isn't a problem of where the folder is placed physically. The fact that
you have made the folder a virtual folder under your own application would
make it part of your application and therefore able to see the session
variables for the app.

The problem most likely is that you have made this virtual folder into an
application in it's own right. Open the properties on the virtual folder
and on the virtual directory tab click the remove button. This stops the
folder from acting as it's own application.

Nov 5 '06 #2
I really had high hopes that would work, but it didn't. The forums .asp
page isn't picking up the session vars.
"Anthony Jones" <An*@yadayadayada.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>
"Terry On Windigo" <te***@windigo.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>I think I have figured out my problem but I don't know how to solve it.
We
>are going to start using a forums package and do not want our users to
have
>to login to both our site, and then again to the forums package. The
creator of the forums package provides what seems to be an easy
workaround
for this. Create two session variables, one for ID, the other for
Password,
>and his program will take care of the rest.

I have all of my forums package off the root of the drive that has my
Inetpub directory, and within my IIS settings have a virtual directory
pointing to the actual folder. I'm wondering that since my actual forums
folder is outside my IIS, or if its a virtual directors my Session
Variables
>are not being picked up. I also wonder this for the following reason.
On
all of my pages I have

<% If Session("LoggedIn")= "Proceed" Then
Else
Server.Transfer "LoginReturning.asp"
End If
%>

which keeps people from bookmarking and coming back in without logining
back
>in to the site. However on the forums default.asp page this does not
work,
>which leads me to believe once again it's a placement issue on my
hardrive
with my folders. If I am wrong in my assumptions, and I can do this, how
would I pass the session variable to my default.asp page in my forums
folder? Here is the page that does the checking of my login
verification:

<%
Option Explicit
Dim strConnect
%>
<!-- #Include File="Data.asp" -->
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<%

Dim objconn, objrs
Dim lcsql, strName, strEmail, strPassword, Trial, Expiredate,
strCookie2

Set objconn = Server.CreateObject("ADODB.Connection")
Set objrs=Server.CreateObject("ADODB.Recordset")
objconn.open strConnect

Trial = Date

strEmail = request.form("Email")
strPassword = request.form("password")

lcsql="select * FROM results WHERE Email =
'"+request.form("Email")+"' and password =
'"+request.form("password")+"'"
objrs.Open lcsql,objconn,0,1,1

'No records returned because user not found

If objrs.EOF then
%>
<Script Language=VBscript>
ReturnItem = msgbox( "Either your name or password
was
>incorrect, try again.", vbOKOnly, "INCORRECT ENTRY")
</Script>
<%
Server.Transfer "LoginReturning.asp"

else
Session("LoggedIn") = "Proceed"

'The next two session vars are for the forums page
Session("USER") = request.form("Email")
Session("PASSWORD") = request.form("password")
'Check to see that Session variables were indeed
assigned
response.write Session("PASSWORD")
response.write Session ("USER")
Server.Transfer "Index.asp"
end if
objrs.Close
objconn.Close
%>

</body>

</html>

Terry

It isn't a problem of where the folder is placed physically. The fact
that
you have made the folder a virtual folder under your own application would
make it part of your application and therefore able to see the session
variables for the app.

The problem most likely is that you have made this virtual folder into an
application in it's own right. Open the properties on the virtual folder
and on the virtual directory tab click the remove button. This stops the
folder from acting as it's own application.

Nov 6 '06 #3

"Terry On Windigo" <te***@windigo.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
I think I have figured out my problem but I don't know how to solve it.
We
are going to start using a forums package and do not want our users to
have
to login to both our site, and then again to the forums package. The
creator of the forums package provides what seems to be an easy workaround
for this. Create two session variables, one for ID, the other for
Password,
and his program will take care of the rest.

I have all of my forums package off the root of the drive that has my
Inetpub directory, and within my IIS settings have a virtual directory
pointing to the actual folder. I'm wondering that since my actual forums
folder is outside my IIS, or if its a virtual directors my Session
Variables
are not being picked up. I also wonder this for the following reason. On
all of my pages I have

<% If Session("LoggedIn")= "Proceed" Then
Else
Server.Transfer "LoginReturning.asp"
End If
%>

which keeps people from bookmarking and coming back in without logining
back
in to the site. However on the forums default.asp page this does not
work,
which leads me to believe once again it's a placement issue on my hardrive
with my folders. If I am wrong in my assumptions, and I can do this, how
would I pass the session variable to my default.asp page in my forums
folder? Here is the page that does the checking of my login verification:

<%
Option Explicit
Dim strConnect
%>
<!-- #Include File="Data.asp" -->
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<%

Dim objconn, objrs
Dim lcsql, strName, strEmail, strPassword, Trial, Expiredate,
strCookie2

Set objconn = Server.CreateObject("ADODB.Connection")
Set objrs=Server.CreateObject("ADODB.Recordset")
objconn.open strConnect

Trial = Date

strEmail = request.form("Email")
strPassword = request.form("password")

lcsql="select * FROM results WHERE Email =
'"+request.form("Email")+"' and password = '"+request.form("password")+"'"
objrs.Open lcsql,objconn,0,1,1

'No records returned because user not found

If objrs.EOF then
%>
<Script Language=VBscript>
ReturnItem = msgbox( "Either your name or password
was
incorrect, try again.", vbOKOnly, "INCORRECT ENTRY")
</Script>
<%
Server.Transfer "LoginReturning.asp"

else
Session("LoggedIn") = "Proceed"

'The next two session vars are for the forums page
Session("USER") = request.form("Email")
Session("PASSWORD") = request.form("password")
'Check to see that Session variables were indeed assigned
response.write Session("PASSWORD")
response.write Session ("USER")
Server.Transfer "Index.asp"
end if
objrs.Close
objconn.Close
%>

</body>

</html>

Terry
It sounds like you have set up the virtual directory as an application in
its own right.
In the directories properties on the virtual directory tag click the remove
button to stop the directory acting as an application.

Note the physical location of the folder is not significant.
Nov 6 '06 #4

"Terry On Windigo" <te***@windigo.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
>I really had high hopes that would work, but it didn't. The forums .asp
page isn't picking up the session vars.

look at the top of your asp page and check that it does not have
EnableSessionState=False

if that is not the case i refere to AJ's advice
>

"Anthony Jones" <An*@yadayadayada.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>
"Terry On Windigo" <te***@windigo.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>I think I have figured out my problem but I don't know how to solve it.
We
>>are going to start using a forums package and do not want our users to
have
>>to login to both our site, and then again to the forums package. The
creator of the forums package provides what seems to be an easy
workaround
for this. Create two session variables, one for ID, the other for
Password,
>>and his program will take care of the rest.

I have all of my forums package off the root of the drive that has my
Inetpub directory, and within my IIS settings have a virtual directory
pointing to the actual folder. I'm wondering that since my actual
forums
folder is outside my IIS, or if its a virtual directors my Session
Variables
>>are not being picked up. I also wonder this for the following reason.
On
all of my pages I have

<% If Session("LoggedIn")= "Proceed" Then
Else
Server.Transfer "LoginReturning.asp"
End If
%>

which keeps people from bookmarking and coming back in without logining
back
>>in to the site. However on the forums default.asp page this does not
work,
>>which leads me to believe once again it's a placement issue on my
hardrive
with my folders. If I am wrong in my assumptions, and I can do this,
how
would I pass the session variable to my default.asp page in my forums
folder? Here is the page that does the checking of my login
verification:

<%
Option Explicit
Dim strConnect
%>
<!-- #Include File="Data.asp" -->
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<%

Dim objconn, objrs
Dim lcsql, strName, strEmail, strPassword, Trial, Expiredate,
strCookie2

Set objconn = Server.CreateObject("ADODB.Connection")
Set objrs=Server.CreateObject("ADODB.Recordset")
objconn.open strConnect

Trial = Date

strEmail = request.form("Email")
strPassword = request.form("password")

lcsql="select * FROM results WHERE Email =
'"+request.form("Email")+"' and password =
'"+request.form("password")+"'"
objrs.Open lcsql,objconn,0,1,1

'No records returned because user not found

If objrs.EOF then
%>
<Script Language=VBscript>
ReturnItem = msgbox( "Either your name or password
was
>>incorrect, try again.", vbOKOnly, "INCORRECT ENTRY")
</Script>
<%
Server.Transfer "LoginReturning.asp"

else
Session("LoggedIn") = "Proceed"

'The next two session vars are for the forums page
Session("USER") = request.form("Email")
Session("PASSWORD") = request.form("password")
'Check to see that Session variables were indeed
assigned
response.write Session("PASSWORD")
response.write Session ("USER")
Server.Transfer "Index.asp"
end if
objrs.Close
objconn.Close
%>

</body>

</html>

Terry

It isn't a problem of where the folder is placed physically. The fact
that
you have made the folder a virtual folder under your own application
would
make it part of your application and therefore able to see the session
variables for the app.

The problem most likely is that you have made this virtual folder into an
application in it's own right. Open the properties on the virtual folder
and on the virtual directory tab click the remove button. This stops the
folder from acting as it's own application.


Nov 6 '06 #5
Follow up to those that helped. It is now working for me. The answer was
to stop it running as an application which all of you said. It didn't work
initially, then something clicked in my head and told me to stop and start
IIS. When I did that it worked. You guys really helped me out. I would
never have thought of the correct answer. Thanks, again.

Terry

"Slim" <me@here.comwrote in message
news:Oi**************@TK2MSFTNGP02.phx.gbl...
>
"Terry On Windigo" <te***@windigo.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
>>I really had high hopes that would work, but it didn't. The forums .asp
page isn't picking up the session vars.


look at the top of your asp page and check that it does not have
EnableSessionState=False

if that is not the case i refere to AJ's advice
>>

"Anthony Jones" <An*@yadayadayada.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>>
"Terry On Windigo" <te***@windigo.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl.. .
I think I have figured out my problem but I don't know how to solve it.
We
are going to start using a forums package and do not want our users to
have
to login to both our site, and then again to the forums package. The
creator of the forums package provides what seems to be an easy
workaround
for this. Create two session variables, one for ID, the other for
Password,
and his program will take care of the rest.

I have all of my forums package off the root of the drive that has my
Inetpub directory, and within my IIS settings have a virtual directory
pointing to the actual folder. I'm wondering that since my actual
forums
folder is outside my IIS, or if its a virtual directors my Session
Variables
are not being picked up. I also wonder this for the following reason.
On
all of my pages I have

<% If Session("LoggedIn")= "Proceed" Then
Else
Server.Transfer "LoginReturning.asp"
End If
%>

which keeps people from bookmarking and coming back in without logining
back
in to the site. However on the forums default.asp page this does not
work,
which leads me to believe once again it's a placement issue on my
hardrive
with my folders. If I am wrong in my assumptions, and I can do this,
how
would I pass the session variable to my default.asp page in my forums
folder? Here is the page that does the checking of my login
verification:

<%
Option Explicit
Dim strConnect
%>
<!-- #Include File="Data.asp" -->
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<%

Dim objconn, objrs
Dim lcsql, strName, strEmail, strPassword, Trial, Expiredate,
strCookie2

Set objconn = Server.CreateObject("ADODB.Connection")
Set objrs=Server.CreateObject("ADODB.Recordset")
objconn.open strConnect

Trial = Date

strEmail = request.form("Email")
strPassword = request.form("password")

lcsql="select * FROM results WHERE Email =
'"+request.form("Email")+"' and password =
'"+request.form("password")+"'"
objrs.Open lcsql,objconn,0,1,1

'No records returned because user not found

If objrs.EOF then
%>
<Script Language=VBscript>
ReturnItem = msgbox( "Either your name or
password
was
incorrect, try again.", vbOKOnly, "INCORRECT ENTRY")
</Script>
<%
Server.Transfer "LoginReturning.asp"

else
Session("LoggedIn") = "Proceed"

'The next two session vars are for the forums page
Session("USER") = request.form("Email")
Session("PASSWORD") = request.form("password")
'Check to see that Session variables were indeed
assigned
response.write Session("PASSWORD")
response.write Session ("USER")
Server.Transfer "Index.asp"
end if
objrs.Close
objconn.Close
%>

</body>

</html>

Terry

It isn't a problem of where the folder is placed physically. The fact
that
you have made the folder a virtual folder under your own application
would
make it part of your application and therefore able to see the session
variables for the app.

The problem most likely is that you have made this virtual folder into
an
application in it's own right. Open the properties on the virtual
folder
and on the virtual directory tab click the remove button. This stops
the
folder from acting as it's own application.



Nov 7 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Al Jones | last post by:
This is a repost form the vbscript newgroup - if this isn't the appropriate group would you point me toward one that is. Basically, I seem to be losing session data part way though preparing an...
6
by: Lina Manjarres | last post by:
Hello, I have a session variable in a login page. Then I go to a form page where I uses the ProfileID and the UserID. Then I go to a result page where I would like to use the UserID as a filter,...
4
by: PJ | last post by:
A particular page seems to be having issues with correctly setting Session variables. I am setting a couple of session variables on the Page_Unload event. While stepping through code, the...
31
by: Harry Simpson | last post by:
I've come from the old ASP camp where session variables were not used. When i started using ASP.NET in 2001, I started using them again because it was ok from what I'd read. I've been merrily...
10
by: tshad | last post by:
I have been using the default session state (InProc) and have found that I have been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much...
3
by: Alan Wang | last post by:
Hi there, Once my application gets complicated and complicated. I found it's really hard to keep track of Session value I am using in my asp.net application. I am just wondering if anyone have...
3
by: Phillip N Rounds | last post by:
I'm writing a user control which has two states: Active & InActive. I additionally am required that there to be only one active control per page, and all logic has to be contained within the...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
26
by: BillE | last post by:
Some ASP.NET applications use Session Variables extensively to maintain state. These should be re-written to use viewstate, hidden fields, querystring, etc. instead. This is because if a user...
12
by: MrHelpMe | last post by:
Hello again all, I've finished my whole application and now I don't like the whole session variables that I am using. I have a form, user fills in info clicks submit and using CDOSYSMail an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.