473,668 Members | 2,542 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asp Session state ??

I'm pretty new to asp.

It seems that I am assigning to the session rather than comparing against.
I want to compare it in the first peice of code but it seems that I am
assigning to it. When the user first requests the page they are not a
member.
Heres my code:
If(Session("IsM ember") = "True") then
'Do Nothing
End if

'should still not be True

If(Session("IsM ember") = "True") then
Response.write( "IS TRUE")
End If

'Response.write is working telling me that the first part of the code
assigned to the session
'Am I doing something wrong??

Jul 19 '05 #1
3 2456
"Ron Vecchi" <ve******@comca st.net> wrote in message
news:e6******** ******@TK2MSFTN GP10.phx.gbl...
I'm pretty new to asp.

It seems that I am assigning to the session rather than comparing against.
I want to compare it in the first peice of code but it seems that I am
assigning to it. When the user first requests the page they are not a
member. Try this:

Dim isMember
isMember = Session("IsMemb er")

If isMember = True then

Else

End If

b.t.w. Your code should work normally. Maybe the issue is with "True"
(String) instead of True (boolean)
Heres my code:
If(Session("IsM ember") = "True") then
'Do Nothing
End if

'should still not be True

If(Session("IsM ember") = "True") then
Response.write( "IS TRUE")
End If

'Response.write is working telling me that the first part of the code
assigned to the session
'Am I doing something wrong??



Jul 19 '05 #2
Insert these lines at the top of your ASP page:
<%
Response.Write( "Session Variable Value: " & Session("IsMemb er"))
%>

If you dont see anything next to the above sentence then your assumption is
correct. If not, your assumption is wrong and you are setting the session
variable somewhere.

HTH

"Ron Vecchi" <ve******@comca st.net> wrote in message
news:e6******** ******@TK2MSFTN GP10.phx.gbl...
I'm pretty new to asp.

It seems that I am assigning to the session rather than comparing against.
I want to compare it in the first peice of code but it seems that I am
assigning to it. When the user first requests the page they are not a
member.
Heres my code:
If(Session("IsM ember") = "True") then
'Do Nothing
End if

'should still not be True

If(Session("IsM ember") = "True") then
Response.write( "IS TRUE")
End If

'Response.write is working telling me that the first part of the code
assigned to the session
'Am I doing something wrong??


Jul 19 '05 #3
Ron Vecchi wrote on 14 jul 2003 in
microsoft.publi c.inetserver.as p.general:
I'm pretty new to asp.

It seems that I am assigning to the session rather than comparing
against. I want to compare it in the first peice of code but it seems
that I am assigning to it. When the user first requests the page they
are not a member.
Heres my code:
If(Session("IsM ember") = "True") then
'Do Nothing
End if

'should still not be True

If(Session("IsM ember") = "True") then
Response.write( "IS TRUE")
End If

'Response.write is working telling me that the first part of the code
assigned to the session
'Am I doing something wrong??


You are using serverside asp vbscript using far to much brackets and
using true as a string, not as a boolean.

Try:

=== /file1.asp:

<%
Session("IsMemb er") = True
%>

=== /file2.asp:

<%
If Session("IsMemb er") then
Response.write "'IsMember' IS TRUE<br>"
Else
Response.write "You are an intruder !<br>You skipped file1.asp"
End if
%>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #4

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

Similar topics

5
3647
by: Phil Grimpo | last post by:
I have a very odd situation here. I have an administration page, where based on a users permissions, a recordset is called from the SQL server which has a list of paths to "Module Menus". Each of these menus are then placed into the page by calling Server.Execute(rs_Modules("ModulePath")). This works fine for up to 15 "menus" After that, the session variables that were set (not including those called by Global.ASA) are no longer set. ...
3
6021
by: Nhi Lam | last post by:
Hi, I understand that there are 3 modes in which I can configure the SessionStateModule. What I need is an out of process Session State store with fail over support. The "SQL Server Mode" seems to be it, but I heard there is quite a bit of degradation in performance for using this mode. My next option is the "State Server Mode". However, this mode does not give me the fail over support. Is there anything that I can do the enhance the...
2
2171
by: John A Grandy | last post by:
for high traffic public websites , what are the proven options for session-state storage & management ? is an out-of-process state-server generally preferred over a sql-server ? what are the relevant criteria ? is the primary criteria max expected total storage size (for all active sessions) versus max ram available on the state-server machine ? if ADO.NET objects (such as small DataTables) must be stored in session-state , is any...
1
2406
by: Johan Nedin | last post by:
Hello! I have a problem with SQLSession state on my ASP.NET pages. SQLSession state behaves very different from InProcess session state, which I think is very bad. I can understand some of the differences, e.g that every object you store in SQLSession state have to be serializable, but other differences are very unfortunate.
10
3500
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 more time I have on a session? If I do a refresh, does reset the session clock? Do you have have to go to another page to reset the session timeout or will a postback also do it? This is important as we have a few pages that a user
9
5305
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of copy paste (I hear this will improve in ASP.Net 2 via master pages). When I navigate from one page to the next the header and footer user controls lose their state because they are effectively different instances of the user control. Is there...
5
548
by: Sean | last post by:
Problem with sessions I have created an application without concern for sessions. As it turns out I think that might be my undoing. What I have: I have an online quiz. I don’t need to know users or save any data. If the application crashes or user exits the program they should simply start again. Pretty basic. All interactions are stored in an array (not much going on to save to a
18
3432
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 File-New-Window creates an instance of IE in the same process with the same SessionID as the parent window is in big trouble. This fundamentally restricts the usefullness of using session state management. I probably missed it somewhere - can...
11
3643
by: Glenn | last post by:
Hi I've been experimenting with managing state using the Session object. I've created a simple WS with a couple of methods, one which sets a string value, another that retrieves it. Each method has the WebMethodAttribute.EnableSession set to true. When I run the test page the session is maintained. However, using a console application, in between setting the string value and attempting to
0
8459
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8371
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8889
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8572
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8652
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7391
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.