Questions tagged [stateless]

Stateless apps don't expose any information about what has happened or changed since it started running

Stateless apps don't expose any information about what has happened or changed since it started running. They give the same response to the same request, function or method call, every time. HTTP is stateless in its raw form - if you do a GET to a particular URL, you get (theoretically) the same response every time. The exception of course is when we start adding statefulness on top, e.g. with ASP.NET web apps :) But if you think of a static website with only HTML files and images, you'll know what I mean.

521 questions
18
votes
2 answers

OAuth 2.0. No session? (stateless)

I'm going to implement OAuth 2.0 and REST API with it to grant different permissions per users and also to scale well. To scale well, stateless is easier because there is NO file, database, in-memory based session with it. Below is how I…
jwchang
  • 10,584
  • 15
  • 58
  • 89
16
votes
1 answer

How to make Spring Security OAuth2 really stateless / get rid of "state" parameter?

I'm currently working on a project where we want the user to sign in via Facebook and other OAuth2 providers. Furthermore the REST api should be stateless. Therefore no cookies/jsessionids should be created/utilized. For authorization against the…
andy
  • 1,852
  • 2
  • 20
  • 31
16
votes
4 answers

What is the difference between stateless and immutable?

I often hear the term "Stateless" and "Immutable". For example, HTTP is a stateless protocol, and a String object is an immutable object. But I have a hard time grasping the difference between the two. When I create a stateless object, it doesn't…
Laurent Bourgault-Roy
  • 2,774
  • 1
  • 30
  • 36
15
votes
5 answers

How do I make my Web Application stateless yet still do something useful?

I've seen this advice... ideally the web should follow the REST principle and be completely stateless. Therefore a single URL should identify a single resource, without having to keep the navigation history of each user. ...and I read the…
RichardHowells
  • 7,826
  • 3
  • 24
  • 24
14
votes
1 answer

Stateless with cookie vs stateful

I found sth like this: "stateful – keep track of the previously stored information which is used for current transaction. stateless – every transaction is performed as if it were being done for the very first time. There is no previously stored…
user3528733
  • 1,259
  • 7
  • 20
  • 37
14
votes
3 answers

Stateless Authentication Library in NodeJS

I believe the best practice for RESTful API's is to be stateless. I read abit about stateless authentication but am not totally clear how to implement it (looks like a mess of tokens etc). PassportJS is a nice authentication library, but its not…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
13
votes
2 answers

Is it difficult to make a mainly stateless web application with Wicket?

I've been working with Wicket for month or two now, making simple web applications with it and getting used to models and so forth. Now I'd like to move forward and see if I can put what I've learned so far to use and create a medium/large web…
John
  • 2,571
  • 6
  • 32
  • 40
13
votes
3 answers

Stateful vs. Stateless Webservices

Imagine a more complex CRUD application which has a three-tier-architecture and communicates over webservices. The client starts a conversation to the server and doing some wizard like stuff. To process the wizard the client needs feedback given by…
Christopher Klewes
  • 11,181
  • 18
  • 74
  • 102
13
votes
1 answer

Differences : @SessionScoped vs @Stateful and @ApplicationScoped vs @Singleton

I would like to know, what are the principal differences between : javax.enterprise.context.SessionScoped and javax.ejb.Stateful javax.enterprise.context.ApplicationScoped and javax.ejb.Singleton I know that a @SessionScoped and a @Stateful allows…
gokan
  • 1,028
  • 1
  • 14
  • 30
12
votes
1 answer

Is stateless visitor pattern possible in C++?

I was trying to translate the following Haskell code to C++: data List t = Nil | Cons t (List t) The straightforward translation of the algebraic data type to the stateless Visitor pattern yields the following Java code interface List { R…
Rotsor
  • 13,655
  • 6
  • 43
  • 57
12
votes
1 answer

How to design a stateless REST Login with 2 Factor Authentication (2FA)?

I'm struggling with the concept of how to design a stateless RESTful authentication API with multi-factor authentication. Almost by definition, the need of a 2FA requires multiple states; logging in with a username/password, then submitting a "code"…
Eric B.
  • 23,425
  • 50
  • 169
  • 316
12
votes
2 answers

Stateless spring security oauth2 provider

I want to setup a simple OAuth2 provider based on spring-boot, spring-security and spring-oauth2. I got everything working on a single instance machine: For an OAuth2 authorization, the user is sent to /oauth/authorize. Most user's are not logged in…
Jan
  • 2,803
  • 6
  • 36
  • 57
11
votes
4 answers

RESTful APIs must be stateless, but what about concurrency?

I'm curious how I solve the concurrency issue for a RESTful API. More specifically, I have a collection of objects that need manual examination and update, e.g. a number of rows that need a column updated by hand; however, if I open up the API to a…
M. Herold
  • 684
  • 1
  • 7
  • 18
11
votes
2 answers

Unique Constraint in a RESTFul architecture

With 15 years of stateful client-server software development experience (and it's inherent problems) I'm still trying to grasp the concept of statelessness in a RestFul architecture. Suppose I have a generic interface to post business objects to my…
user1677120
  • 223
  • 3
  • 6
10
votes
5 answers

Should the strategy pattern be stateless?

Must a class that is a "gang of four" strategy be completely stateless (ie no fields) or can it contain immutable state (ie final fields)?
murungu
  • 2,090
  • 4
  • 21
  • 45
1
2
3
34 35