Featured post
php - quantity of data that should be stored in session -
assumption
understand it's not store data , needed simple.
state today
use minimum needed , using simple data types (int , strings)
storing user's id , tell if logged in.
must of functions static or singleton has built each post/get.
have trouble representing current state , changing it.
, largely static site.
of state representing goes javascript .
target
other hand if i'll create object represent entire website easier me maintain user's input , including database interaction.
simple question, how data should stored there?
example
1 of things want implement objects relate database tables,
let's take page "car.update()".
if store object it, extends connection database methods
crud.
when handle post page details put them in properties needed , call update method.
situation now: need create new object details , make static update
another example
storing previous search result , filter using new data
in many cases ideal amount none. store username in cookie along hmac hash used verify cookie created site, , else database (or cache) needed. makes easy load balance across servers because server can handle request , there's no state needs shared between them.
this approach wouldn't appropriate banking or other top-security uses because if gets cookie connect you. sites you're not doing super critical it's great. risk can mitigated adding expiration mechanism cookie handling. see chubbards great answer related hmac question more info.
- Get link
- X
- Other Apps
Comments
Post a Comment