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
214
votes
10 answers

Why is it said that "HTTP is a stateless protocol"?

HTTP has HTTP Cookies. Cookies allow the server to track the user state, the number of connections, last connection, etc. HTTP has persistent connections (Keep-Alive) where several requests can be sent from the same TCP Connection.
Jose Nobile
  • 3,243
  • 4
  • 23
  • 30
141
votes
2 answers

CSRF Token necessary when using Stateless(= Sessionless) Authentication?

Is it necessary to use CSRF Protection when the application relies on stateless authentication (using something like HMAC)? Example: We've got a single page app (otherwise we have to append the token on each link:
126
votes
2 answers

How to do stateless (session-less) & cookie-less authentication?

Bob uses a web application in order to achieve something. And: His browser is on diet, therefore it does not support cookies. The web application is a popular one, it deals with a lot of users at a given moment - it has to scale well. As long as…
117
votes
8 answers

Stateless vs Stateful

I'm interested in articles which have some concrete information about stateless and stateful design in programming. I'm interested because I want to learn more about it, but I really can't find any good articles about it. I've read dozens of…
Team-JoKi
  • 1,766
  • 3
  • 15
  • 23
41
votes
5 answers

Securing REST API using custom tokens (stateless, no UI, no cookies, no basic authentication, no OAuth, no login page)

There are lots of guidelines, sample codes that show how to secure REST API with Spring Security, but most of them assume a web client and talk about login page, redirection, using cookie, etc. May be even a simple filter that checks for the custom…
41
votes
2 answers

OAuth's tokens and sessions in REST

The other minute I read an article on OAuth. It described especially the tokens being exchanged between client and service provider during a series of requests. The article also mentioned that OAuth gains significant popularity in RESTful APIs as…
Boldewyn
  • 81,211
  • 44
  • 156
  • 212
37
votes
3 answers

Stateless Object Oriented Programming vs. Functional Programming?

One of the prime reasons for the increasing shift in attention towards functional programming these days is the rise of multithreading/processing and the advantages of FP's focus on side-effect free, stateless computation in making scalability…
donalbain
  • 1,158
  • 15
  • 31
34
votes
4 answers

ReactJS difference between stateful and stateless

I am trying to understand the exact difference between React's stateful and stateless components. Ok, stateless components just do something, but remember nothing, while stateful components may do the same, but they remember stuff within this.state.…
Socrates
  • 8,724
  • 25
  • 66
  • 113
31
votes
8 answers

Stateless Session Beans vs. Singleton Session Beans

The Java EE 6 Tutorial says: To improve performance, you might choose a stateless session bean if it has any of these traits: The bean’s state has no data for a specific client. In a single method invocation, the bean performs a generic task for…
deamon
  • 89,107
  • 111
  • 320
  • 448
30
votes
2 answers

What are the benefits of a stateless web application?

It seems some web architects aim to have a stateless web application. Does that mean basically not storing user sessions? Or is there more to it? If it is just the user session storing, what is the benefit of not doing that?
Genadinik
  • 18,153
  • 63
  • 185
  • 284
24
votes
8 answers

Passing/Accessing props in stateless child component

I know you can pass all a react components props to it's child component like this: const ParentComponent = () => (

Parent Component

) But how do you then retrieve those props…
Paulos3000
  • 3,355
  • 10
  • 35
  • 68
20
votes
10 answers

Do stateless random number generators exist?

Is there a difference between generating multiple numbers using a single random number generator (RNG) versus generating one number per generator and discarding it? Do both implementations generate numbers which are equally random? Is there a…
Gili
  • 86,244
  • 97
  • 390
  • 689
20
votes
3 answers

What does REST's principle of statelessness actually means?

After reading the introductory articles on REST (Fielding's thesis and other) my perception of statelessness is that there should be no session objects on the server side. Yet, i see Flask (and maybe other REST frameworks in different technologies…
badmaash
  • 4,775
  • 7
  • 46
  • 61
18
votes
2 answers

Flutter State Management (BloC): Stateless vs Stateful widget

So I am reading through Bloc for state management for flutter. Since Bloc allows you to sink and stream (rebuilding a widget based on the input), then is it possible to build an app mostly with stateless widgets? As an example, let say I make lots…
Steve Kim
  • 5,293
  • 16
  • 54
  • 99
18
votes
2 answers

Find component by display name when the component is stateless functional, with Enzyme

I have the following components: // Hello.js export default (React) => ({name}) => { return (
Hello {name ? name : 'Stranger'}!
) } // App.js import createHello from './Hello' export default (React) => () => { …
1
2 3
34 35