State Management :: Identify First Or Second Time Visit To Website
Sep 30, 2010
I work in a multi server , multi webfarm environment (without sessions). We need to be able to identfy if a customer has arrived here for the first or has been before (even though they have not logged in)Not only will we change the text of our salutations depeding on this state but we will also use it in other busness logic. I can check for the existance of a cookie when they fire the Session_onStart event but I would have to write a cookie out to show they had previously visited for the next time the customer came to call.
If I wrote the cookie out in the Session_onStart then somehow I would have to tell the website that this was a first time visit. Also as this is a stateless webfarm - the next server may be different from the previous one which would fire a new Session_onStart event in its own right - which would see the cookie and assume it was not my first visit, even though it was my first visit on a different web page of the web site.
I dont want to write it out and say if its within X minutes of the cookie creation time you are still in your first visit as that x minutes wouldnt work 100% of the time If I dont write the cookie out on Session_onStart then when could I write it out?
I read somewhere the website quits running after sometime if no one pings it. I wanted to know is there any way on IIS 6 that will keep the website up all the time(alive) even if no one accesses it
I've done a bit of searching on this subject and haven't found anything so far. I am successfully using the Profile object and am saving Profile records away into my SQL Server Database. I have checked using the stored procedures and viewed the individual records to know they are there. However, I want to create a WebForm that can enumerate through all of the users in my Membership DB (Same DB as the Profile DB) and list each user in a grid showing what values each user has within their profile. For example:
Username Profile Element 1 Profile Element 2 Profile Element 3 bob true false true fred true false true
I want however to replace the 'Profile Element 1' etc etc to display the actual name of the Profile. I would like to do this programmatically so I don't have to recompile the website everytime I add a new Profile element.
I have one website in which there is one page along with one ascx as registered into it. In the ascx where user can add some order details and click on "Make Payment" button, then there are following 2 cases...Case I: If user was not logged in, then a modal popup will open which has login ascx with 2 buttons Register & Login. In this case user either Login or Register and continue with "Make Payment".
I tried to set a Cookies by Response.Chookies("chookie1") into a user's machine and found difficult to get the Cookies by Request.Chookies("chookie1"). I think that is because the person used various cs(User-Agent) (browser names?). Here are some of them:
I'm still debugging my application so it's on the local server. As I debug and stop then debug again, eventually lblNoOfUsers.text turns to "0" instead of "1", even as I'm navigating my application. It only turns to "1" again if I log out and sign back in. It's almost as though Membership.GetNumberOfUsersOnline my login are referencing two different session states. How is this possible? Does asp.net create a new session state cookie each time I start debugging?
is my session related tag in web.config file but most of the time if i idle 20 minutes then its automatically timedout and went to my login page, is there any solution ?
I'm having problems with the sessions states on my application.When I run the application off my c drive all the session variables are there. Everything works perfectly, nothing is wrong.However, when I publish the site to a server test environment, the session variables disappear. Why is this? Is there a way around this?Here is my codes.for retrieving it. Note, the session.count actually is 0.
The value of the label1 is "system3=testing" no matter if I run it the first or subsequent times. It should be "1" after the first time. Does anyone know why?
protected void Page_Load(object sender, EventArgs e) { HttpCookie bCookie3 = new HttpCookie("System3"); // Cookie declaration //if (bCookie3["System3"] != null) //{ // Response.Cookies.Remove("System3"); // return; //} int val = 1; System.Diagnostics.Debugger.Break(); if (HttpContext.Current.Request.Cookies["System3"] == null) { bCookie3["System3"] = "testing"; bCookie3.Expires = DateTime.Now.AddYears(2); Response.Cookies.Add(bCookie3); Response.Cookies["System3"].Expires = bCookie3.Expires; //Maximum year of cookie's life } else { bCookie3["System3"] = val.ToString(); } Label1.Text = Request.Cookies["System3"].Value; }
I have developed application in ASP.NET and placed on UAT server (windows XP IIS) where it worked fine but since I moved on production server (windows 2003 + IIS) after sometime its keep on expiring the session.
Please suggest urgently if possible how i can make it not to expire session at all.
I want to be able to detect from C# code how long ago a user logged into the site. I need to take a particular action if it is their first time logging in. IsNewSession does not work, unfortunately.
I set session timeout is 30 at my webconfig. But when i upload a file and click submit button already session timeout. I uploaded 1kb file. I can submit 1 time.
I totally have no idea on how to do this. How can I get the time everytime the user use my system. We are using AD account here so we don't have login and log out. All I want is as long as the user browse to my system whether he is working or it or not become away or any, I will record its time and save it in my database then accumulate all the time he spent in my system for admin reporting.
I am working on a asp.net 3.5 app. In the Global.asax in the Application_Error method, I am logging everthing to ddatabase (log4Net).
I have a session limit of 20 minutes. What happens when the user hits that limit and then clicks on the Submit Button of the app. ?Will that generate any exception? and will that exception be logged into my database as I am logging all exceptions in my Application_Error method.
I am writing a chat application, in which a chat starts in a chat room. Now, i want this room active only for a certain amount of time and not more. i.e 1 hour etc. So, to check the time constantly what and how should i write something in the background, so that when the time is over, the sessions of all the users logged in at that chat room get destroyed. And the users are again redirected to the login page. e.g The chat has been setup from 3 to 4 pm. At 3.55 everybody should be given a popup that the chat will end in 5 mins. And at 4 everybodys session should be destroyed and they should be redirected to the login page.
i have simple form which consists of 2 labels and 2 buttons, the first label will display the current time and second label will display the cached time for 2 mins which is absolute..
no w when i click on first button only current time have to get update,, and when i click on second button both current time cached time have to be updated even though the cached time of 2 mins not elapsed also.
By default when the Session ends then the End-User should be directs to the login page and logs in again. Is there any way to open the login page in a new page rather than opening it in the same page(upon Session time out)?