473,406 Members | 2,369 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,406 software developers and data experts.

Why is Session working for all users except one?

I'm having a problem saving session information on one form and retrieving it
on a subsequent form...for only one out of a number of users. Actually, I'm
not absolutely certain it's a session problem but I'm hoping the experts can
help me figure that out.

Our application uses a session variable to "pass" info from one form to the
next. It has always worked fine for our users until a few weeks ago when one
of our users started having a problem. Every time they would try to move from
Form #1 (DefectEdit1.aspx) to Form #2 (DefectEdit2.aspx), they would get
redirected to the application's home page, which is what Form #2 is supposed
to do whenever it doesn't find anything stored in the session variable (Form
#1 is supposed to have saved the session variable right before redirecting to
Form #2). So my assumption has been that there is a problem with the session
information being saved.

The problem seems to be machine dependent. All the other users are having no
problems with these forms on their own machines. The user in question does
not have a problem if he logs in on someone else's machine and uses the
application. Other users have the same problem if they go to this guy's
machine, even if they log in as themselves.

I figured there must be something in the Internet Options settings on his
machine that must be preventing him from saving session state. I made sure
that his IE Privacy settings were set to "Medium" (the default), which I
thought would allow most first-party cookies to be stored. I'm pretty sure
this is how the other users' machines are set up.
Didn't help. So we went to the Security tab and made sure that the
"Internet", "Local intranet", and "Trusted sites" zones were all set to the
"Default" security level for each zone. Still didn't help. Finally, we made
sure that the root web address for the application was added to the "Local
intranet" zone's list of sites on the Security tab, just to make sure that
the application was being forced into the default security settings for
"Local intranet". Still didn't help. The user is running XP Professional and
we've downloaded all current Windows updates.

Any help would be greatly appreciated. We've tried everything we can think
of at this point.

Thanks,
Scott Wickham

Here's the code from Form #2 that checks the session info:

// Page load
private void Page_Load(object sender, System.EventArgs e)
{
// If user doesn't have permission to view this page then redirect
if (CheckPermissions() == false)
Response.Redirect(Request.ApplicationPath +
"/Modules/Workflow/WorkflowActionsPending.aspx?Module=ncr");

if (this.IsPostBack)
return;

// If there is no PartInformation object in session then we didn't arrive
here from DefectEdit1, so redirect.
//
// ******* This is where the redirection is occurring *******
//
if (Session["PartInformation"] == null)
Response.Redirect(Request.ApplicationPath);

// Grab WO number if it exists
if (Request.Params["workOrder"] != null)
WorkOrder.Text = Request.Params["workOrder"].ToString();

// Get part information from session
part = (Business.PartInformation)Session["PartInformation"];

// Populate form fields with data from part info object in session
PopulateFields();
}

Here's the code from Form #1 that sets the session info:

// Load the part information and pass the object to the next form.
private void NextPage_Click(object sender, System.Web.UI.ImageClickEventArgs
e)
{
Business.PartInformation part = new
Business.PartInformation(PartNumber.Text);

// If PO is visible and something was selected then set PO number
if (PONumbers.SelectedItem != null)
{
if (PONumbers.SelectedItem.Text.Length > 0)
part.PoNumber = PONumbers.SelectedItem.Text;
}

// Loads the rest of the part information
part.Load();

// If part is "buy" then must choose PO
if (part.SourceCode.ToLower() == "b" && (PONumbers.SelectedItem == null ||
PONumbers.SelectedItem.Text.Length == 0))
{
Message.Text = "Part is bought so you must select a PO.";
DivMessage.Visible = true;
return;
}

// Store in session
Session["PartInformation"] = part;

// Redirect and pass WO number if it was supplied.
Response.Redirect(Request.ApplicationPath +
"/Modules/Defects/NewDefect2.aspx?workOrder=" + WONumber.Text);
}
Jul 21 '05 #1
1 2004
Are Cookies enabled?

Session variables are referenced by a session id cookie.

"Scott Wickham" <Sc**********@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
I'm having a problem saving session information on one form and retrieving
it
on a subsequent form...for only one out of a number of users. Actually,
I'm
not absolutely certain it's a session problem but I'm hoping the experts
can
help me figure that out.

Our application uses a session variable to "pass" info from one form to
the
next. It has always worked fine for our users until a few weeks ago when
one
of our users started having a problem. Every time they would try to move
from
Form #1 (DefectEdit1.aspx) to Form #2 (DefectEdit2.aspx), they would get
redirected to the application's home page, which is what Form #2 is
supposed
to do whenever it doesn't find anything stored in the session variable
(Form
#1 is supposed to have saved the session variable right before redirecting
to
Form #2). So my assumption has been that there is a problem with the
session
information being saved.

The problem seems to be machine dependent. All the other users are having
no
problems with these forms on their own machines. The user in question does
not have a problem if he logs in on someone else's machine and uses the
application. Other users have the same problem if they go to this guy's
machine, even if they log in as themselves.

I figured there must be something in the Internet Options settings on his
machine that must be preventing him from saving session state. I made sure
that his IE Privacy settings were set to "Medium" (the default), which I
thought would allow most first-party cookies to be stored. I'm pretty sure
this is how the other users' machines are set up.
Didn't help. So we went to the Security tab and made sure that the
"Internet", "Local intranet", and "Trusted sites" zones were all set to
the
"Default" security level for each zone. Still didn't help. Finally, we
made
sure that the root web address for the application was added to the "Local
intranet" zone's list of sites on the Security tab, just to make sure that
the application was being forced into the default security settings for
"Local intranet". Still didn't help. The user is running XP Professional
and
we've downloaded all current Windows updates.

Any help would be greatly appreciated. We've tried everything we can think
of at this point.

Thanks,
Scott Wickham

Here's the code from Form #2 that checks the session info:

// Page load
private void Page_Load(object sender, System.EventArgs e)
{
// If user doesn't have permission to view this page then redirect
if (CheckPermissions() == false)
Response.Redirect(Request.ApplicationPath +
"/Modules/Workflow/WorkflowActionsPending.aspx?Module=ncr");

if (this.IsPostBack)
return;

// If there is no PartInformation object in session then we didn't arrive
here from DefectEdit1, so redirect.
//
// ******* This is where the redirection is occurring *******
//
if (Session["PartInformation"] == null)
Response.Redirect(Request.ApplicationPath);

// Grab WO number if it exists
if (Request.Params["workOrder"] != null)
WorkOrder.Text = Request.Params["workOrder"].ToString();

// Get part information from session
part = (Business.PartInformation)Session["PartInformation"];

// Populate form fields with data from part info object in session
PopulateFields();
}

Here's the code from Form #1 that sets the session info:

// Load the part information and pass the object to the next form.
private void NextPage_Click(object sender,
System.Web.UI.ImageClickEventArgs
e)
{
Business.PartInformation part = new
Business.PartInformation(PartNumber.Text);

// If PO is visible and something was selected then set PO number
if (PONumbers.SelectedItem != null)
{
if (PONumbers.SelectedItem.Text.Length > 0)
part.PoNumber = PONumbers.SelectedItem.Text;
}

// Loads the rest of the part information
part.Load();

// If part is "buy" then must choose PO
if (part.SourceCode.ToLower() == "b" && (PONumbers.SelectedItem == null ||
PONumbers.SelectedItem.Text.Length == 0))
{
Message.Text = "Part is bought so you must select a PO.";
DivMessage.Visible = true;
return;
}

// Store in session
Session["PartInformation"] = part;

// Redirect and pass WO number if it was supplied.
Response.Redirect(Request.ApplicationPath +
"/Modules/Defects/NewDefect2.aspx?workOrder=" + WONumber.Text);
}

Jul 21 '05 #2

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

Similar topics

0
by: renster | last post by:
I was wondering if someone could help me with a problem that I'm having in retrieving session variables on a site I am working on for a friend. I have made the site more developer friendly by...
9
by: Marcus | last post by:
Hello, Currently all of my php pages use SSL, not just my initial login. Originally I thought this would be more secure, but after thinking about things and looking at sites like Amazon and...
11
by: Vishal | last post by:
Hello, can anybody tell me how I can extend the session expiry time? Is it done via code or via IIS? Sorry I am new and dont know about this.
1
by: Scott Wickham | last post by:
I'm having a problem saving session information on one form and retrieving it on a subsequent form...for only one out of a number of users. Actually, I'm not absolutely certain it's a session...
1
by: fizbang | last post by:
This should be impossible, but for some reason, people are not getting individual sessions. They start a session. I set the session("application") variable to the unique number generated by an...
3
by: Ned Balzer | last post by:
Hi all, I posted this question some time ago in an earlier thread but so far I still don't have an understanding of why this is happening or what I can do to fix it. I use Session variables,...
2
by: mharness | last post by:
Hello, I'm working on an approach to systematically and automatically log users on and off an app that precludes users from sharing usernames and passwords. I have most of that working except...
43
by: davidkoree | last post by:
I mean not about cookie. Does it have something to do with operating system or browser plugin? I appreciate any help.
2
by: pradeep | last post by:
Hello all, There is system. Users are logging , working and logout. Suppose, 5 users are working and Admin wants to find out no. of users working on system with their name ? How to find this...
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: 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
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
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
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...
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...
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
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...

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.