session

php - How to save the form data temporary

Hello all, I have designed a user profile form, a long form which is quite complicated. Before the user can submit and save it, the form needs to be validated. Here is the question: When the form is saved into the DB, there are multiple tables involved. Now I would like to introduce a function called "Save Form" which internally doesn...

MVC optimization for Session.Clear(), Session.Abandon(), Session.RemoveAll()?

I am using a few sessions that should be terminated when the user is done. I stumbled on these 3 session killers. When is the best time to use these as I use sessions more time than not. Also, is there any other session termination I am not aware of? ...

IIS7 ASP.NET in-proc session NOT being lost after app recycle.

I've got an ASP.NET MVC app running under IIS7. It's using the default in-proc session management, which, according to all that I read, should lose the users' session after an app pool recycle. It doesn't seem to be losing it though. Even an IIS reset doesn't lose the session. Has something changed in IIS7 that keeps the session alive? ...

Hibernate: different object with the same identifier value was already associated with the session

when I use the DAO.update(userbean), session.SaveOrUpdate(e);throw the Exception:different object with the same identifier value was already associated with the session the function is like next: public E save(E e) { Session session = null; try { session = sessionFactory.openSession(); log.debug("session="+s...

Flash + pyAMF + Django session cookie security

First off, if there is a true, official way of having flash/flex's NetConnections usurp the session/cookie state of the surrounding web page, so that if the user has already logged in, they don't need to provide credentials again just to set up an AMF connection, please stop me now and post the official answer. Barring that, I'm assumin...

How can i maintain session with subdomain and https.

Hello to all, I have a problem related to subdomain and https request. I am trying to route from http to https where my http address is subdomain.domain.com and https address is domain.com/subdomain. But the problem is when i switched from http to https i loose my session variables. How can i persist my session variables in both http ...

DotNetOpenAuth on web farm

I am implementing DotNetOpenAuth for both an OpenId provider and a relying party. In both cases, the servers are behind a load balancer, so for any HTTP request, we can't assume that we'll hit the same server. It appears that DotNetOpenAuth depends on the Session to store a pending request key. Because the server may change between requ...

classic asp sessions (time-out set in IIS) lasting longer than it should

Hi, I am finding that my classic asp sessions (time-out set in IIS) are lasting longer than they should. If you set the IIS session timeout to 1 minute, i'd expect them to last 1 minute between the last http request of a page and if a new http request comes in > 1 min after, as new session created. I have a page setup that has a JavaS...

Unique ID in PHP vs. $_POST Form

Hi, Here's the idea: User hits a page where he can create an "item. On this page he can upload files and before submitting form (powered by Flash for users with Flash/Javascript support and powered by pure PHP + 5 file unputs + iframe for users without Flash/Javascript). It needs to stay on the same page. When user hits a page I'm usin...

When to use URL/session/cookie variables?

I do a lot of php and javascript, but I think this is relatively language-agnostic question. Are there any best-practices for when to use each of: URL variables SESSION variables cookies I understand the inherent limitations of what some of them can't do, but it seems like their use can overlap sometimes, too, and those instances ar...

Storing a reference to the Parent control in Session

I have an ASP.NET web form that has a "container" usercontrol that hosts several custom user controls on the page. The controls can be hosted directly in the container or can be children of other usercontrols. The container usercontrol has several public properties exposed that I sometimes need to get to from within the child user cont...

Session management in interceptors and action of struts 2 application

I am having problem with session management in struts2. I am setting an attribute in the session in an interceptor which is the default interceptor for my entire application. In my action I am implementing SessionAware interface and grabbing the session as a Map. But the attribute which I set in the interceptor is not present in the sess...

Should session be used to handle error message for form validation?

I'm creating registration page and I've done basic client side (JS) form validation. Now I am to write server side validation. What I have done is call request.getParameter(): String username = request.getParameter("username"); Then if the username input is not valid, I put error message to ArrayList: ArrayList<String> errors = new...

ASP.NET MVC's AsyncController and Session data

We have a somewhat complex and long-running action method for which we'd like to show a progress bar. The javascript grid that we're using requires that saving and loading data be done in a single request (save first then load), and also requires us saving data to session. Our initial thought was to just use an AsyncController, but the...

Wordpress cforms session gets lost only in Firefox!

Hi there, I am using wordpress 3.0 with cforms (newest version). Here I use a multi-page form. It works fine in Internet Explorer It works fine in Safari It works fine in Google Chrome It does not work in Firefox! After Step 2 you get redirected to Step 1 instead of 3. In the debug information you can see it lost the session and creat...

Ignoring if statement

I have a facebook login system that seems to work fine, but I want to redirect to the home page if the user is logged in. SO this is the top of my page <?php session_start(); if(!empty($_SESSION)){ header("Location: home.php"); } But that gets ignored and it runs the login script as if $_SESSION is empty, even tho I print the Sessio...

Auth timeout problems with CakePHP

This is really bugging me. Has been for years. No matter what I do with core.php or php.ini, my logins timeout after about an hour - usually. Some deployments of identical code and configuration timeout after a respectable amount of time. This is what I have at the moment on one site - timed out after about an hour: session.gc_divisor ...

Flash and Sessions

Howdy, First of all, I'm using KohanaPHP Framework. I've impletemented SWFUpload successfully, working quite nice. I'm having only one issue. The main problem is I need to allow users to upload attachments before submitting form. So I decided to use Session var to store attachments array. Unfortunately, it is working inly if I use HTM...

ASP.NET MVC 2 - Avoiding repeatedly querying the database for static data?

What can I do to avoid the repeated loading of static data every time a page is loaded in ASP.NET MVC2? This is pretty wasteful, and I would like to fix it. My master page has the typical User Name + Company Name display in the top right corner. But because of the stateless nature of MVC, this data has to be looked up every single time...

HttpContext.Current.Session["key"] throws ArgumentNullException

I have the following code: if (null != HttpContext.Current && null != HttpContext.Current.Session && null != HttpContext.Current.Session["key"]) { // some cool magic } which sometimes throws ArgumentNullException in HttpContext.Current.Session["key"] (HttpContext.Current and HttpContext.Current.Session are not null). How ...