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

Users are timing out, even while they work

TPS
In my login routine I am doing the following

// Create the authentication ticket

FormsAuthenticationTicket authTicket = new

FormsAuthenticationTicket(1,personID.ToString(),Da teTime.Now,DateTime.Now.Ad
dMinutes(60),false,roles);

//(version,name,creation,Expiration,Persistent,role data)

string x = FormsAuthentication.SlidingExpiration.ToString();

//x == true;

// Now encrypt the ticket.

string encryptedTicket = FormsAuthentication.Encrypt(authTicket);

// Create a cookie and add the encrypted ticket to the cookie as data.

HttpCookie authCookie = new
HttpCookie(FormsAuthentication.FormsCookieName,enc ryptedTicket);

// Add the cookie to the outgoing cookies collection.

Response.Cookies.Add(authCookie);

In my web.config file I have the following

<authentication mode="Forms">

<forms

loginUrl="/pages/login.aspx"

name="dusacookie"

timeout="60"

path="/">

</forms>

</authentication>

<sessionState

mode="InProc"

stateConnectionString="tcpip=127.0.0.1:42424"

sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"

cookieless="false"

timeout="20"

/>


Any Idea why my users are loosing their session even though they are still
working?

Thanks

TPS
Nov 18 '05 #1
6 1059
Hi TPS,

Thanks for posting in the community!
From your description, you used the FormsAuthentication in your ASP.NET
web application. However you found that the users visiting the web app will
timing out before they should be( do you means they'll be redirect to login
page rapidly or just be directed right after they have be authenticated
from the login page?)

As for this problem, I'd like to confirm some further things as I mentioned
above. Does the situaiton you met is that the Authentication cookie is
unable to store at client side? I think you may turn all the page's trace
in the @Page directive
set Trace="true" . That'll enable use to track the request's cookie
collectoin. Please check the cookie collection tosee whether the
Authentiation cookie occurs in the cookie collection? its name is just the
one you set in the web.config as below:
<forms
.....
name="dusacookie"
....>

Also, have you tried create another simple web app to use
formauthentication on the machine or even another server to see whether
this problem remains?

Please try out the above things. If you have any thing unclear above or
have any new findings, please feel free to post here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #2
TPS
Cookies Collection
Name Value Size
ASP.NET_SessionId vpqfltqcpl5kcy55nxaiwduz 42

Steve, it does not look like the "dusacookie" is in the cookies collection.
That must be why I am timing out. Ideas why it is not in the collection?

Thanks for your help.
-----------------------------------------------------------------
TPS
Nov 18 '05 #3
TPS

Sorry Steve, I had not logged in yet, so here is my cookies collection after
I log in.
So it looks like is in the collection.

Cookies Collection
Name Value Size
ASP.NET_SessionId pm10bs45iyett3ntzuzi33n2 42
dusacookie
2C35167C8BFA17C8C4C55BDACF046B02F4EFDBC44EFC6B14D9 3C829351C82047A7A253FE7044
D7A 155

TPS
Nov 18 '05 #4
Hi TPS,
Thanks for your response and the test result you provided. From the "cookie
collection" report, the FormAuthentication's token cookie is stored
correctly at clientside. So we may look for some other things. As for the
timeout, I still not quite sure on the whole sequence the problem happends.
Would you please provide me the detailed steps / sequence the problem
occurs? For example,
from the user login,
after how long ...
then ..

Also, it would be more helpful if you could create another simple project
just simple enought to repro the problem. Then, I may have a test on it on
my side. Do you think so?
Meanwhile, if you have any new findings , please also feel free to let me
know.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Nov 18 '05 #5
TPS
Steve, thanks for your help

I can't make another test site. I am running as fast as I can to maintain
this site, as we go into live testing.

It looks like the session is timing out because the errors always occur when
we are trying to access a session variable like so:

int personid = (int)Session["PersonID"];

The error is "Object reference not set to an instance of an object"

I know I should check this beforehand, but that still will not solve the
fact that the session timesout.

This happens when a user is using the site. They are not idle, they are
constantly hitting the site, then for no reason, they get the error.
-----------------------------------------------------------------
Thanks,
TPS
Nov 18 '05 #6
Hi TPS,
Thanks for you followup. Does the problem also happen if you create a new
web app and applied the forms authentiaction? And I think you may have a
look at the certain web app's trace. via the
http://web app path/trace.axd

to see whether the trace info will provide any clues?

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #7

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

Similar topics

16
by: Jonas Smithson | last post by:
I'm going to say something now that may seem to completely contradict a previous post of mine, in which I basically said that taking a "who cares" attitude about certain browsers (because of their...
9
by: Amir Ghezelbash | last post by:
Hey every body i had a question i am in process of writing an application, where this application needs to check the database on hourly bases to see if they are any information that are needed...
3
by: gregory_may | last post by:
I have an application where I am using a System Thread to capture the screen & Broadcast it to clients. Its "working", but the timing on the background thread gets wildly erratic at times. Some...
7
by: Steven D'Aprano | last post by:
I have two code snippets to time a function object being executed. I expected that they should give roughly the same result, but one is more than an order of magnitude slower than the other. ...
2
by: Jim in Arizona | last post by:
My goal, somehow, is to populate a dropdownlist with all the user names in active directory. I don't even know where to begin, really. I added a reference to System.DirectoryServices so I could...
3
by: stephenedavis | last post by:
I keep getting the error message "Invalid postback or callback argument" on my asp.net 2.0 pages in Internet Explorer. These pages are simple, and just to make sure there is nothing wrong with the...
2
by: Steven D'Aprano | last post by:
The timeit module is ideal for measuring small code snippets; I want to measure large function objects. Because the timeit module takes the code snippet argument as a string, it is quite handy...
15
by: Jay | last post by:
I have a multi threaded VB.NET application (4 threads) that I use to send text messages to many, many employees via system.timer at a 5 second interval. Basically, I look in a SQL table (queue) to...
5
by: =?Utf-8?B?dWxpbGxpbGxpYQ==?= | last post by:
I've had two issues plaguing me for 4 months now and I haven't gotten anywhere. I'm into making 2D games and these things are essential to games. These are my issues: 1. I need timing precise...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.