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 😉