session

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

Hibernate session.close() not returning connection to pool

My application has long running transactions and hence I tried the option session.close() at the end of every method to ensure that the connection objects are not held indefinitely for long time. When session.close() option is used, I could see that the Hibernate's session object and the corresponding Connection object obtained from se...

Detect new $_SESSION variable without refresh. Maybe AJAX?

Hi there, I'm currently building a website which fetches youtube videos and flickr images and lets users comment on them on the website. While having it's own commenting system, the website also has an option to login with youtube/flickr to comment on youtube or flickr with their usernames. I'm doing this by opening a popup window (re...

Java App Engine - Sessions are not working in GAE server

I'm developing a Java web application on GAE platform in which I'm storing an User object in session. When I test my code in local development server (Windows XP + Eclipse), I'm able to get the User object back from the session. But when I deploy the same piece of code to GAE server, I'm facing issues with Session. I'm able to retrieve ...

Unable to make Spring 3 Session Concurency Control work

Hi all, Using Spring Security 3.1.0, I cannot seem to get the concurrent session control feature to work. When I log into my system at the same time using IE and FireFox (using my local workstation) I see my user principle in the session registry twice. I am expecting the concurrent session control to log me out or throw an exception or...

Session Management in iPhone

Hi, I need to manage server sessions in iPhone. As I researched there are many ways. One way is to use the apple native method calls by make use of the NSURLConnection and NSHTTPCookieStorage classes. However using the 3rd party libraries like ASIHttpRequest can also be helpful cos it already has implemented the above scenarios. So what...

Session timeout response in AJAX

In my application, I'm loading some table using AJAX. But when user's session times out it gives me login page as response that gets loaded in table area. I would like to redirect to login page may be in javascript when session timeout occurs during AJAX call. ...

Should I use sessions for "LOGINS" on my site?

I have a classifieds website, where anyone (no need for login currently) can post a classified. It is PHP based. The procedure for posting is currently like this: click on "New Classified" ---> fill in a form of all information and hit "View classified before publishing it" ---> the form submits to a "verify classifieds" page, where...

Will Hibernate flush my updated persistent object when calling session.close()(using FlushMode.AUTO)?

Hi, It's pretty much in the title. I know that session.close() does not flush the session but what I'm not too sure is about the promise of FlushMode.AUTO. From the Docs: FlushMode.AUTO The Session is sometimes flushed before query execution in order to ensure that queries never return stale state. This is the default flush mode. ...

Sessions get messed up on external host.

The problem sounds like this: The log-in using sessions works perfect on my localhost, but when the EXACTLY same files are uploaded to my host (hostgator), the sessions don't or, or they get messed up. Also the log-out feature doesn't work on the host. I've checked and every page has the session_start(); inside it. The session is not d...

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 session variables lost on header redirect using PHP_SELF in the form action

I have a multi-step form, let's say for the sake of ease it's 2 steps. First step I want to select a radio button and based on that radio button selection it takes me to a certain page, but I also want that selection stored in a session. I have 2 pages: page1.php session_start(); if(isset($_POST['post'])) { if (($_POST['country'] == ...

PHP: on session death change DB

I am using PHP for a project. I have set the session life to 0 so that when the user closes the browser, the session dies and he/she is logged out. However, I have a status variable in the DB which stores the information telling me if the user is logged in or not. I use this to inform other users the status of a particular user. When th...

Session variables & cookies disappearing in IE when going from https to http page

On an Apache server, I have set of Profile pages within a folder protected by htaccess (/main/profile). After a user updates their profile, I want to set a $_SESSION['timelineuser']= or a session cookie for use back in the main folder of the site (/main/) which is unsecure. On the unsecure page I want to check to see if $_SESSION['timel...

Using Rack middleware for cross-domain sessions in same app

I have a white-labelled Rails app that allows me to create a variety of different new websites, each with their own TLD, but all powered by the same app. It's an ecommerce app so all orders are processed on a single, different TLD. For example, I might have three TLDs: domain_a.com domain_b.com domain_c.com and orders are processed o...

session cookies work on emulator, but not real device

I'm developing an app using android 2.1. I have a problem with using session cookies to login to a RESTful web service. The code works fine on the emulator, but when I run it on my HTC Magic, the cookie logic doesn't work. I've confirmed that the magic is receiving cookies in the headers by listing them (see attached). Can anyone say wh...

managing NHibernate sessions for multi-tenant asp.net application

I have scoured the web and have yet to find and example that matches my requirements. What I have is an existing multi-tenant asp.net application where all users authenticate against a single SQL Server database. This database also contains several other settings type data that is used within the application. Each client after authent...

Spring MVC - Session - Request

I have a Spring MVC (3) Controller and I trying to put in the annotations but failed Heres my code outline @Controller public class SpringController{ @RequestMapping("/welcome") public String myHandler(@RequestParam("id" String id)){ //My RequestParm is able to do the job of request.getParameter("id") HttpSession session = request...

Django sessions and cookie - and many domains

In Django's settings I can specify the domain that is used for session's cookie - like it is stated here. It's quite useful for me, as I have subdomains defined that should share the cookies with master domain - so I define the SESSION_COOKIE_DOMAIN = '.domain.com'. What I bumped into now is the requirement to serve many domains - like ...

Spring: Inject bean depended on context (session/web or local thread/background process)

Is it possible to create a factory or proxy that can decide if thread is running in (Web)Request or background-process (ie. scheduler) and then depending on that information, it creates a session bean or a prototype bean? Example (pseudo Spring config :) <bean id="userInfoSession" scope="session" /> <bean id="userInfoStatic" scope="pro...