473,587 Members | 2,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Loosing Session variables...

This is basic Session handling but it's not working.

On a Page1.aspx I have this code:
-----------------------------------
If TextBox1.Text = "admin" And TextBox2.Text = "Admin01" Then

Session("admin" ) = "True"

Response.Redire ct("Page2.aspx" )

End If

---------------------------------

On Page2.aspx I have this code
------------------------------------------------
Response.Write( Session("admin" ))
------------------------------------------------

I get nothing... and if I debug, the Session("admin" ´) is Nothing...

Do I need to do something to turn session handlign on?

best regards/
Lars

Nov 19 '05 #1
6 1371
Lars Netzel wrote:
This is basic Session handling but it's not working.

On a Page1.aspx I have this code:
-----------------------------------
If TextBox1.Text = "admin" And TextBox2.Text = "Admin01" Then

Session("admin" ) = "True"

Response.Redire ct("Page2.aspx" )

End If


Response.Redire ct (default) is destructive to Sessions...use the
overloaded Redirect, and pass "false" as the second parameter.

HTH...
Chris
Nov 19 '05 #2
Overloaded? What do you mean?

/Lars
"Chris Hyde" <ch*****@nodire cwayspam.com> skrev i meddelandet
news:eG******** ******@TK2MSFTN GP14.phx.gbl...
Lars Netzel wrote:
This is basic Session handling but it's not working.

On a Page1.aspx I have this code:
-----------------------------------
If TextBox1.Text = "admin" And TextBox2.Text = "Admin01" Then

Session("admin" ) = "True"

Response.Redire ct("Page2.aspx" )

End If


Response.Redire ct (default) is destructive to Sessions...use the
overloaded Redirect, and pass "false" as the second parameter.

HTH...
Chris

Nov 19 '05 #3
Response.Redire ct("page.aspx" , false)
-----Original Message-----
Overloaded? What do you mean?

/Lars
"Chris Hyde" <ch*****@nodire cwayspam.com> skrev i meddelandet
news:eG******* *******@TK2MSFT NGP14.phx.gbl.. .
Lars Netzel wrote:
This is basic Session handling but it's not working.

On a Page1.aspx I have this code:
-----------------------------------
If TextBox1.Text = "admin" And TextBox2.Text = "Admin01" Then
Session("admin" ) = "True"

Response.Redire ct("Page2.aspx" )

End If


Response.Redire ct (default) is destructive to Sessions...use the overloaded Redirect, and pass "false" as the second parameter.
HTH...
Chris

.

Nov 19 '05 #4
it didn't help... I still loose the Session variables
/Lars
"V. Jenks" <an*******@disc ussions.microso ft.com> skrev i meddelandet
news:06******** *************** *****@phx.gbl.. .
Response.Redire ct("page.aspx" , false)
-----Original Message-----
Overloaded? What do you mean?

/Lars
"Chris Hyde" <ch*****@nodire cwayspam.com> skrev i meddelandet
news:eG****** ********@TK2MSF TNGP14.phx.gbl. ..
Lars Netzel wrote:
This is basic Session handling but it's not working.

On a Page1.aspx I have this code:
-----------------------------------
If TextBox1.Text = "admin" And TextBox2.Text = "Admin01" Then
Session("admin" ) = "True"

Response.Redire ct("Page2.aspx" )

End If

Response.Redire ct (default) is destructive to Sessions...use the overloaded Redirect, and pass "false" as the second parameter.
HTH...
Chris

.

Nov 19 '05 #5
Possibly your browser is blocking cookies? Without allowing cookies, you
don't get session support. The alternative to is use cookie-less sessions,
which are enabled in web.config.

"Lars Netzel" <tr*****@apa.se > wrote in message
news:uj******** ********@tk2msf tngp13.phx.gbl. ..
This is basic Session handling but it's not working.

On a Page1.aspx I have this code:
-----------------------------------
If TextBox1.Text = "admin" And TextBox2.Text = "Admin01" Then

Session("admin" ) = "True"

Response.Redire ct("Page2.aspx" )

End If

---------------------------------

On Page2.aspx I have this code
------------------------------------------------
Response.Write( Session("admin" ))
------------------------------------------------

I get nothing... and if I debug, the Session("admin" ´) is Nothing...

Do I need to do something to turn session handlign on?

best regards/
Lars

Nov 19 '05 #6

Hello, isn't the response.write to be

"Response.W rite Session("admin" )"

or <%= session("admin" )%>

try this.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #7

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

Similar topics

7
7190
by: Billy Jacobs | last post by:
I am having a problem with my session variable being set to Null for no apparent reason. I am declaring it like the following when the user logs in. dim objUserInfo as new clsUserInfo 'Set some properties objUserInfo.UserName = txtUserName.text.trim objUserInfo...
1
1555
by: Jonk Eidersteldvr | last post by:
Hi, I am using a web application -asp, ado, C#, using CodeBehind files etc.. I am using "InProc" session state and find that session variables are loosing their values between one web form and the next. I have used "InProc" on my development machine and the session variable values are being maintained between pages. I copied two of the relevant forms into another application and using "InProc" session state they maintained their...
8
2283
by: Radu Colceriu | last post by:
HI, I've an asp.net app like this: login.aspx (no frame) :- save in session the user and pass -> framedoc.html :- frameset 2 content 1. menu.aspx 2.docviewver.aspx
2
1404
by: Robert Berezka | last post by:
hi! I am working on a ASP.NET project. My problem with the session vaiable is: Localy on my client computer, where I develope my ASP.Net application, Everything runs fine. When I transfer the hole project to the windows 2003 server (IIS6 is running
9
2091
by: Patrick | last post by:
Hello I'm running two Webservers Using ASP.NET. both are running the same ASP.NET Application, with <sessionState mode="SQLServer" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=myserver;user id=myuser;password=mypw" cookieless="false" timeout="20" /> This seems to work. But we have cases, when users report that they loose the
2
1577
by: Aaric | last post by:
I am developing my web apps on a Win XP Pro SP2 laptop and then uploading them to a Windows Server 2003. My current project involves using session state variables to keep track of user after they have logged in. The login.aspx page contains the following code: if(sAuthorized != "-1" && sAuthorized != "-2") { Session = sAuthorized; Response.Redirect("index.aspx"); }
15
1803
by: cyndi_r2000 | last post by:
Hi Everyone: I have a web application running on .NET 2.0 under IIS 6.0 and users of this application seem to be loosing their session randomly - we havent been able to identify any pattern, except for warnings in the event viewer that say "A process serving application pool xyz terminated unexpectedly." ..NET 1.1 is also installed on the same machine -- there are separate app pools for 2.0 and 1.1 apps.
1
4837
by: Dabbler | last post by:
I set some strings and integers in Session but when I get to my redirected page the values are null. I'm running on localhost Windows XP Pro but using remote SQL 2005 database. Not doing anything with caching. I am using Master files and sub master files. Also using a bit of Atlas but none of this should be clearing my session variables? <%@ Page Language="C#" MasterPageFile="~/Admin.master"
5
2140
by: Mirovk | last post by:
The onclick action associated to my form´s radio buttons call to a vbscript were the session values are changed, this happens correctly but with the onclick action associated to my continue button always shows the value =1 instead the values selected under my radio buttons (Values= 4,3 or 1) I am showing the code. Ideas welcome.
0
7924
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
8349
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8221
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
6629
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...
1
5722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3845
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
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1192
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.