Pros and Cons of Sticky Session / Session Affinity load blancing strategy?

Pros: It’s easy– no app changes required. Better utilizes local RAM caches (e.g. look up user profile once, cache it, and can re-use it on subsequent visits from same user) Cons: If the server goes down, session is lost. (Note that this is a con of storing session info locally on the web server, not … Read more

Get Request and Session Parameters and Attributes from JSF pages

You can get a request parameter id using the expression: <h:outputText value=”#{param[‘id’]}” /> param—An immutable Map of the request parameters for this request, keyed by parameter name. Only the first value for each parameter name is included. sessionScope—A Map of the session attributes for this request, keyed by attribute name. Section 5.3.1.2 of the JSF … Read more

Maintaining Session through Angular.js

Here is a kind of snippet for you: app.factory(‘Session’, function($http) { var Session = { data: {}, saveSession: function() { /* save session data to db */ }, updateSession: function() { /* load data from db */ $http.get(‘session.json’).then(function(r) { return Session.data = r.data;}); } }; Session.updateSession(); return Session; }); Here is Plunker example how you … Read more

How to invalidate session in JSF 2.0?

Firstly, is this method correct? Is there a way without touching the ServletAPI? You can use ExternalContext#invalidateSession() to invalidate the session without the need to grab the Servlet API. @ManagedBean @SessionScoped public class UserManager { private User current; public String logout() { FacesContext.getCurrentInstance().getExternalContext().invalidateSession(); return “/home.xhtml?faces-redirect=true”; } // … } what will happen to my current … Read more

ASP.NET Web API session or something?

in Global.asax add public override void Init() { this.PostAuthenticateRequest += MvcApplication_PostAuthenticateRequest; base.Init(); } void MvcApplication_PostAuthenticateRequest(object sender, EventArgs e) { System.Web.HttpContext.Current.SetSessionStateBehavior( SessionStateBehavior.Required); } give it a shot 😉

How to end a session in ExpressJS

Express 4.x Updated Answer Session handling is no longer built into Express. This answer refers to the standard session module: https://github.com/expressjs/session To clear the session data, simply use: req.session.destroy(); The documentation is a bit useless on this. It says: Destroys the session, removing req.session, will be re-generated next request. req.session.destroy(function(err) { // cannot access session … Read more