session-variables

PHP session variable changes between pages

I have a session variable that I set like this: <?php $token = md5(uniqid(rand(), true)); session_start(); $_SESSION['token'] = $token; print $_SESSION['token']; ?> Then on another page I have this: <?php session_start(); print $_SESSION['token']; ?> The problem is that they don't match. I get two completely different strings. regi...

Problems with Object Member Corruption when using Session In-Proc

I'm currently working on solving a bug with a site I've been working on for some time now. The issue I'm having is my session objects are being overwritten occasionally when users call the site at the same time. My current session mode is In-Proc and after reading another thread regarding a similar issue I believe my problem may be rela...

Removing / Ignoring Session items that will cause .NET deserialization errors

I'm trying to be clever by allowing a small validation method to be defined "inline" in ASCX templates as an Action<,>, like so: <%= OnValidation(delegate(FormSubmission form, FormResult errors) { // form checks in here, append errors to errors variable if required }) %> It actually works a treat, but in order to ensure it can be ...

Why is my SESSION array OK on one page but empty on another?

Hi, I have a class that sets various session variables. After I set the session variable I do a var dump of SESSION and get an output of them all. all good so far. Then I navigate to another page. session_start(); // i call this right after opening the php tag var_dump($_SESSION); // i call this after setting the variables and it's...

PHP: Using session variables set in an iframe in multiple iframes

Hi, I use a content management system called liferay that lets you add iframes to a page very easily. I have various different iframes that i want to use the same php session variables. This wouldn't be an issue if the main webpage was setting the sessions. the problem is the sessions are created in one iframe and I'm wanting to use the...

Session data lost between pages PHP?

I am making a news add form using post method. In the second page i make data validation. I define the variables like $message = $_POST["message"] and after that $_SESSION['message'] = "$message"; after that I echo the session var and everything look fine the data appear. And when I click to send which go to another page to add the data ...

Using the conditional operator ? to check for null session variable

Take a look at this code: System.Web.SessionState.HttpSessionState ss = HttpContext.Current.Session["pdfDocument"] ?? false; if ((Boolean)ss) { Label1.Text = (String)Session["docName"]; } Basically I want to check if HttpContext.Current.Session["pdfDocument"] is not null, and if it isn't to cast to...

Is it possible to access Spring MVC annotated session vars across multiple controllers?

I have a web app running Spring 3.0 and using Spring-MVC. I have a few controllers set up like this: @Controller @RequestMapping("/admin") @SessionAttributes({"clientLogin", "selectTab", "user", "redirectUrl"}) public class AdminController { ... } @Controller @SessionAttributes({"clientLogin", "selectTab", "user", "redirectUrl"}) publi...

PHP spits out the course/location/time of event, combine results to create item store on page with session and create cart item to send to paypal?

if(isset($_POST['submit'])){ $eventSelect = $_POST['eventSelect']; $eventLocation = $_POST['eventLocation']; $eventDate = $_POST['eventDate']; echo "Event Name:";echo $eventName; echo "<br /><br />Event Location:";echo $eventLocation; echo "<br /><br />From :"; echo $eventDate; } When a user goes to the site ...

Drupal: session variable is lost when not logged in

I have a module in Drupal 6 that saves some information in the $_SESSION array. I use this information to customize some content in another page. The problem is that when I'm not logged in Drupal, the information is not saved in the session. When I'm logged in, it works as expected. Any ideas? Thanks. ...

Session not maintained between mysite.com and www.mysite.com

Hi I am using a session to maintain some variables between different pages on my site. While it works fine when I move from www.mysite.com/a to www.mysite.com/b, the session variables are lost if I move from mysite.com/a to www.mysite.com/b Any idea how I can make sure the session is maintained irrespective of www or no www? The websi...

Session variable not set in Spring

Hello, I have a Spring controller which is putting a variable in the session: public class LoginFormController extends SimpleFormController { public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command) throws Exception { request.getSession().setAttribute("authenti...

How to default null session values to blank strings in C#

I'm used to using VB.net for web programming. Often, I have something like: Dim s as string = Session("s") I get a string value for s from the web session. If there is no value in the web session, I get a blank string. However, AFAIK, in C#, I have to have something like the code below to do the same thing. string s; try { s = Ses...

PHP $_SESSION Implementation

Does anyone know how PHP maps session IDs to $_SESSION arrays? In other words, given session ID x, where does PHP pull the values from to populate the $_SESSION array? And given a session ID and the url it came from, is there any possibility of someone being able to gain access to the values in the $_SESSION array? ...

zend framework question

Hi stackworld, Well heres my question. In my project im using a rest service to authenticate clients. That part is ok as I have used a simple authentication by hashing a user id and a password together. After the authentication I want to open to the users few other rest services through the modular scheme in zend framework. I am curre...

Magento - Passing data between a controller and a block

Really quick and simple question but I can't find a decent answer to this - What is the best way to pass data from a controller to a block in Magento. Incase it makes a difference, I am loading the layout as follows: $this->loadLayout(array('default', 'myModule_default')); $this->_initLayoutMessages('customer/session') -...

how can i limit my django foreign key selection by a property stored in the django session

i have a small application i am implementing with django and i'm having a slight challenge. I'm trying to limit the queryset for my relationships within my application by a particular property. Now the catch is, the exact value of the property isn't known until the user logs into the application. an example is limiting a set of comments ...

Classic ASP Ubound returns 9 getting subscript out of range

Sorry if this has been covered, I couldn't find anything specifically to this issue in my searches. I am trying to debug a classic ASP application. I need to print the session variables, one of which is an array. My code is below, I keep getting Subscript out of range, usually this means that the array is empty (Ubound returns -1) but i...

PHP session variable security

Is it a bad idea to store a raw sql query in a php session variable for later use? Does this present any security issues? ...

Object with Lazy initialization-adding to Session or Viewstate

I have a two tier architecture based website-data layer and UI layer. I have a web page, I get the id of a customer from the querystring and I build the customer object from that id. I have several tabs in my webpage, so, unless I need the data, I dont have to load the data for the grids which are in the tabs that are not clicked. That's...