473,396 Members | 1,766 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,396 software developers and data experts.

Session State and cookies

Hello,

I've read somewhere that sessionstate does not work when a browser has
disabled cookies, so I wanted to test this and did the following:

I added two aspx pages (c#), in the first I set a session variable like
this: Session["Test"] = "Hello";

On the first page there is a button that navigates to the second page,
like this: Server.Transfer('Default2.aspx');

In the second page in the load event, I do this:
Response.Write(Session["Test"];);

After this, I disabled all cookies in my browser (internet explorer 6)
bij using the privacy tab in IE Options. But after disabling the
cookies, my project still works fine! How's this possible or am I
understanding something wrong here?

Greetings,
Chris

*** Sent via Developersdex http://www.developersdex.com ***
Feb 12 '08 #1
3 1534
"Chris Zopers" <te***********@12move.nlwrote in message
news:ul**************@TK2MSFTNGP03.phx.gbl...
Hello,

I've read somewhere that sessionstate does not work when a browser has
disabled cookies, so I wanted to test this and did the following:

I added two aspx pages (c#), in the first I set a session variable like
this: Session["Test"] = "Hello";

On the first page there is a button that navigates to the second page,
like this: Server.Transfer('Default2.aspx');

In the second page in the load event, I do this:
Response.Write(Session["Test"];);

After this, I disabled all cookies in my browser (internet explorer 6)
bij using the privacy tab in IE Options. But after disabling the
cookies, my project still works fine! How's this possible or am I
understanding something wrong here?


Most likely the site you are visiting is being seen as a member of the
trusted or intranet zone (probably because you are not using a FQDN). IE
will allow Session cookies for such sites regardless of your privacy
settings.

--
Anthony Jones - MVP ASP/ASP.NET
Feb 12 '08 #2
On the first page there is a button that navigates to the second page,
like this: Server.Transfer('Default2.aspx');
The Session object will work, it just won't "remember" between page calls.
When you Server.Transfer you are still within the same page call so the
values you set are still in the Session. Do a Response.Redirect instead for
a better test.
Feb 12 '08 #3
Okay, that should be the reason, because I tested this in my visual
studio project.....thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Feb 12 '08 #4

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

Similar topics

27
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate...
5
by: Marc Rivait | last post by:
Here is a very interesting scenario. I have a simple test application that loads a page and sets a session variable on the load event. On the first page there is a link to a second page. The...
14
by: Schoo | last post by:
I have an asp.net app that uses session objects (ag. session("UserID")). The app works fine in development/debug mode. I released it to the test server (Windows 2000 server with other .NET...
4
by: Oscar Onorato | last post by:
Hello colleagues: Somebody know that good alternatives I have, in addition to the cookies, to maintain the session state? Where an example of it can be seen? Thanks
9
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...
5
by: Steven Blair | last post by:
I have the following code: Session = new CurrentUser("TEST"); When I postback to the server, the Session is null. My guess is a only the refence to my actual class is stored, rather than 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...
11
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...
2
by: StanB | last post by:
I came across this weird problem: 1. Session state stops working after the app is deployed to another server because IE does not accept cookies. 2. It works if cookieless="true" in the...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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...
0
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,...

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.