session-variables

Does an IIS worker process clear session variables when it recycles?

We're writing an asp.net web app on IIS 6 and are planning on storing our user login variables in a session. Will this be removed when the worker process recycles? ...

Does This ASP.NET Consultant Know What He's Doing?

The IT department of a subsidiary of ours had a consulting company write them an ASP.NET application. Now it's having intermittent problems with mixing up who the current user is and has been known to show Joe some of Bob's data by mistake. The consultants were brought back to troubleshoot and we were invited to listen in on their expl...

PHP session side-effect warning with global variables as a source of data

I'm trying to host a PHP web site that was given to me. I see this warning: Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can...

What's the proper use of php.ini's session.save_path?

I'm running PHP on Windows/IIS. My session variables don't seem to be preserved from page-to-page. This code //echos out the session variables in a nice format for inspection echo "<p><pre>"; print_r($_SESSION); echo "</pre></p>"; outputs blank values, like this Array ( [s_firstvar] => [s_var2] => ...

HttpContext.Current.Session is null when routing requests

Without routing, HttpContext.Current.Session is there so I know that the StateServer is working. When I route my requests, HttpContext.Current.Session is null in the routed page. I am using .NET 3.5 sp1 on IIS 7.0, without the MVC previews. It appears that AcquireRequestState is never fired when using the routes and so the session variab...

Checking for Serialized Objects

Is there a built-in way to know if a given session variable is a serialized object? Say I retrieve a value like $_SESSION['foo'], but I don't know if it was originally a string or if it is a serialized object. Is there some way to check, or once serialized does PHP just see a string as a string as a string? ...

Looking for a hack to prevent rewriting an app without using session variables

Our company uses an app that was originally ColdFusion + Access later converted to classic ASP + MS Sql for task/time tracking called the request system. It's broken down by department, so there's one for MIS, marketing, logistics, etc. The problem comes in when (mainly managers) are using more than one at a time, with 2 browser windows ...

How to write all the data in session to string[] also how to write the data in string [] to session

I using an ASP.net I need to copy all the session data (both session variables and session request variables) to string []. How to do this. Also i need the reverse condition. How to do this in serialization concepts ...

How do I check if session cookies are enabled in Classic ASP?

What's an elegant way in Classic ASP to check if session cookies are enabled in a user's browser using server side code (because javascript might be disabled as well). I have a solution of my own but it looks ugly as hell. @James - that doesn't differentiate between setting a session cookie and a general purpose cookie though (IE lets ...

SQL "SELECT IN (Value1, Value2...)" with passing variable of values into GridView

Hi there, I have a strange encounter when creating a GridView using "SELECT..WHERE.. IN (value1, val2...)". in the "Configure datasource" tab, if i hard code the values "SELECT ....WHERE field1 in ('AAA', 'BBB', 'CCC'), the system works well. However, if I define a new parameter and pass in a concatenated string of values using a varia...

Web authentication state - Session vs Cookie vs ?

What's the best way to authenticate and track user authentication state from page to page? Some say session state, some say cookies? Could I just use a session variable that has the ID of the user and upon authentication, instatiate a custom User class that has the User's information. Then, on every page, verify the session variable is...

How many users is too much when using session variables?

I'm currently using session variables as a cache to cut down the calls to the database. I'm wondering at about how many concurrent users does this stop working at? 1,000, 10,000 ....100,000??? Also will iis start flaking out at a certain load? And are there any alternatives? I know it depends on how much data I'm storing per user, but...

Can I use ASP.NET Session[] variable in an external DLL

Hi all, I have two projects, the DLL project which has all my logic and data access stuff, and the ASP.NET project which does my forms etc. I am a bit confused. I thought if I added the System.Web namespace reference to the DLL project I would be able to reference the Session state information of the ASP.NET page. I could use each pa...

is it a good idea to create an enum for the key names of session values?

instead of doing session("myvar1") = something session("myvar2") = something session("myvar3") = something session("myvar4") = something is doing enum sessionVar myvar1 myvar2 myvar3 myvar4 end enum session(sessionVar.myvar1.tostring) = something session(sessionVar.myvar2.tostring) = something session(sessionVar....

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 * ...

PHP session seemingly not working

Session variables are apparently not working for me. I don't know what I'm doing wrong. This is the code that I'm using to check for a valid password: if ($input_password_hash == $password_hash) { session_start(); $_SESSION['is_user'] = 1; header("Location: ../new_look"); //or Location: index.php } else echo "Wrong password."; ...

PHP Session variable is set, but PHP doesn't see it. Very strange.

Okay, maybe this is because I've been coding for over 24 hours and my eyes are glazing over, but I'm stumped here. Why does this happen: <?php session_start(); $tmp = "index"; echo "A: " . $_SESSION['page_loaded']['index']; // returns 1 echo "B: " . $_SESSION['page_loaded'][$tmp]; // is set, but is empty ?> I feel like I'm missing s...

MySQL equivalent session variable for Oracle

In MySQL, I can create an access a session variable by using a single @. Example initialization: set @myVar = true; Some trigger containing this code: if (@myVar is not true) then execute something What is the equivalent in Oracle 10g? ...

ASP.net session is shared by default?

Hey there, I'm making an application that makes use of session variables. I have created a class "HistoryLine" and another called "HistoryLineCollection" with a list of "HistoryLine"s in it. I then save the instance of the HistoryLineCollection to the session like this: Session["HistoryLines"] = hLines; The problem is that when I watch...

ASP.NET Connection String

I am having some trouble with one of my ASP.NET 2.0 application's connection string. There are instances that I would get a ConnectionString Property Has not Been Initialized problem which occurs randomly and intermittently and without any reason. My Connection string is actually coming from a webservice, because different kinds of use...