Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

Session State and cookies

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris Zopers - 12 Feb 2008 09:34 GMT
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
Anthony Jones - 12 Feb 2008 10:05 GMT
> Hello,
>
[quoted text clipped - 14 lines]
> 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.

Signature

Anthony Jones - MVP ASP/ASP.NET

Chris Zopers - 12 Feb 2008 10:26 GMT
Okay, that should be the reason, because I tested this in my visual
studio project.....thanks!
Aidy - 12 Feb 2008 10:25 GMT
> 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.