Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "flash data"?

I have been doing some tutorials around nodejs. One tutorial mentions a library called "connect-flash" that lets you set "flash data".

I have never heard of this term before could someone please define this? (I found the readme rather unhelpful)

Thanks

like image 874
spinners Avatar asked Aug 01 '14 22:08

spinners


People also ask

What is data flash memory?

Flash memory is a long-life and non-volatile storage chip that is widely used in embedded systems. It can keep stored data and information even when the power is off. It can be electrically erased and reprogrammed. Flash memory was developed from EEPROM (electronically erasable programmable read-only memory).

How is flash data stored?

Flash storage uses memory cells to store data. Cells with previously written data must be erased before new data can be written. Flash storage can also come in several forms, from simple USB sticks to enterprise all-flash arrays.

What is flash memory examples?

Common examples of Flash memory include: Multi-Media Card (MMC) - a Flash-based memory card standard used for solid-state storage in smartphones, digital cameras, music players, video camcorders, and personal computers. These cards store digital information such as text, pictures, audio, and video.

What is flash storage used for?

Flash storage is a solid-state technology that uses flash memory chips for writing and storing data. Solutions range from USB drives to enterprise-level arrays. Flash storage can achieve very fast response times (microsecond latency), compared to hard drives with moving components.


2 Answers

It's a type of user data that you show once and then destroy. Usually a top alert like "Your action has been successful" or similar.

By its nature it's dynamic, so it's saved in the user session and displayed in the very first rendered page, then discarded.

like image 140
Riccardo Galli Avatar answered Sep 18 '22 14:09

Riccardo Galli


Taken from the doc page for the connect-flash library which seems fairly self-explanatory:

The flash is a special area of the session used for storing messages. Messages are written to the flash and cleared after being displayed to the user. The flash is typically used in combination with redirects, ensuring that the message is available to the next page that is to be rendered.

This middleware was extracted from Express 2.x, after Express 3.x removed direct support for the flash. connect-flash brings this functionality back to Express 3.x, as well as any other middleware-compatible framework or application. +1 for radical reusability.

...

Flash messages are stored in the session. First, setup sessions as usual by enabling cookieParser and session middleware. Then, use flash middleware provided by connect-flash.

like image 26
jfriend00 Avatar answered Sep 20 '22 14:09

jfriend00