session

How do retrieve no of uesrs connected on IIS at any point

Hello - I want to know how many users are connected to the IIS web server at any point on a simple .net page. Is there a way using a native .net class in 3.5 that will tell me this information. I want to create a simple web page that will give me the total number of users/open sessions at a given time. Currently, I am using Perfmon to ...

PHP5: Some Session files 0 length?

Hi folks, I'm seeing a strange situation, that I'm trying to figure out if it's a PHP issue, file issue, or normal operation. I have some users complaining about very fast timeouts on our site (session expires?), and checking the php tmp directory, I see things like this: -rw------- 1 www-data www-data 377 2009-01-15 22:46 sess_fc789...

View sessions in Visual Studio when debugging a asp.net application.

Is there a way to view ongoing sessions in Visual studio while debugging a asp.net application? And if there is, can you kill the sessions somehow? I need this cause I need to check what, and how to fix, the problems that occurs when a session indeed has died and the user tries to do something that requires the specific session. ...

asp.net cookies, authentication and session timeouts

I have an asp.net website that uses forms authentication. There are a few things I keep in sessions like username, userID, email, etc. I allow the user to stay logged into the website by setting a long expiration date on the authentication cookie. So it's very common for the session to expire while the user is still authenticated. The ...

Is there a way to access the collection of current sessions in ASP.NET?

Is there any way to access the collection of current sessions in ASP.NET globally from the application? Thanks. ...

var for a class in PHP

Hello. I am using a PHP class for login purposes. The MySQL database that the login process checks for the user is defined like this: class flexibleAccess{ var $dbName = 'mydatabase'; However, as I install the application for different people, this $dbName needs constant changes. I have decided to make a config file where I kee...

Debugging ASP.NET Session State server issues

We have an application that runs over load balanced server instances, and therefore is configured to use the ASP.NET session state service, which is running on one of our DB servers. While both instances of our app can successfully connect to the state server, changes in session state data are not being reflected across both of them. FI,...

Passing LinqDataSource through Session: 'DataContext accessed after Dispose.'

I´m in need to pass some results from the database around. Instead of pass a whole dataset, or a constructed sql query, I tried to pass a LinqDataSource configured object. On the source page, I configure the LinqDataSource object properties Where and WhereParameters using the values set by the user on the controls displayed on the page ...

PHP sessions with HTML

I have a website which uses PHP and HTML pages, I want to create a session which stores a username from the login page. But the login pages are php and the next pages are html. Is this a problem or can I just add a small statement of php into the html page saying <?PHP session_start(); $_session['loginid']=$_post['username']; ?> Or ...

PHP sessions for storing lots of data?

I'm developing a media bookmarking site and am looking for a way to remember whether a user has bookmarked an item (without having to go to the DB every page load to check). I haven't used PHP sessions before, but I'm thinking they would do the trick. Would it make sense to do an initial DB call when the user logs in, grab all the item...

"HttpContext.Current.Session" vs Global.asax "this.Session"

Recently, while working on some code for an ASP.NET project at work. We needed a tracking util to take basic metrics on user activity (page hit count etc) we would track them in Session, then save the data to DB via Session_End in Global.asax. I began hacking away, the initial code worked fine, updating the DB on each page load. I wante...

Where to set session timeout?

The application sets session.timeout in Application_AcquireRequestState event handler. Before session expires, there is notification window popping up. It resets session timeout to, say, 3 minutes (normally, it is 30 minutes), through Application_AcquireRequestState. The notification offers user an option to extend session for another ...

File Upload from Flex to Rails 2 server

Is there any way to upload files from a flex app to a rails 2.2 backend when using the default Cookie Session Store? ...

Filename is different to the filename that exists in DB even though a session is being used

Hello all, I save a file with part of the filename as the session_id using PHP, like this: $newFileName = 'upload_160687_'.session_id().'_160687_'.$originalFileName; I then save the filename as a string using PHP in the DB and it looks like this: upload_160687_l4eef6nqlekhbirv2pvmuf5660_160687_Apple_Microsoft_desktop1-1.jpg Howeve...

How to unit test library that relies on Session object

I have several asp.net mvc websites consuming the same controller and model. This common logic is put in seperate libraries. These libraries use the HttpContext.Current.Session. How can I make these unit testable? I read about the StateValue but can't completely grasp it. Where should I get this StateValue thing? Is it a lib I reference?...

Testing a class with HttpContext.Current.Session in ASP.NET MVC

Hello. I'm adding some tests to a class that uses HttpContext.Current.Session internally and we are porting to ASP.NET MVC. My class looks like this: class Foo { public void foo() { HttpContext.Current.Session["foo"] = "foo"; } } I thought to change it like this: class Foo { IHttpSessionState session; pub...

What are the benefits of session-per-conversation?

Currently I'm using a session-per-request approach to manage Hibernate sessions in a Java web application. I heard the term session-per-conversation thrown around and was wondering what situations it suits and what benefits it can bring over session-per-request? ...

Is this code secure?

<?php session_start(); include("connect.php"); $timeout = 60 * 30; $fingerprint = md5($_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT']); if(isset($_POST['userName'])) { $user = mysql_real_escape_string($_POST['userName']); $password = mysql_real_escape_string($_POST['password']); $matchingUser = mysql_query("SELECT * ...

Does System.Web.Caching.Cache make sense in an ASP.Net MVC app?

Since there is no concept of sessions in ASP.Net MVC and each request is independent of each other would I ever make use of the Cache object to internally cache data in order to minimize db access? The output caching functionality is great for caching view data but if I wanted to cache something like a user profile which should be shared...

Ie8 doesn't pass session cookie for ajax request

I have simple php application, it works on all browsers except on IE8 beta 2, problem occurs when I try to update table field using Ajax call (jQuery post method). Using IE8 debugger I figure out that IE8 doesn't send session cookie so php scripts redirects to login page instead of executing requested action. What can I do to make this...