Correct way to implement session in G-WAN's Ruby -


what correct way implement session on g-wan's ruby, idea:

  1. send random cookie if not exists, or guid cookie fine? how read , write cookie on g-wan's ruby? documentation shows examples on c
  2. create file if not exists on /tmp/rubysessid-#{cookie_guid} php did
  3. read content on every request, , rewrite when changed

but problem be: 2 requests same source on same time rewrite cookie file content @ same time making possible data corruption or inconsistency

is there better way implement session on g-wan's ruby?

web frameworks use databases or key-value stores (sometimes called dictionaries) keep track of sessions.

i not ruby developer guess such features available.

and g-wan lets access http request headers ruby (like other of 15 programming languages), there's no problem access http cookies.

the "documentation shows examples in c" because g-wan written in c c scripts.

there, made sense fill gap g-wan api made c/c++, etc.

that gap not exist in ruby , other scripted languages used web development people have plenty of choices resolve problems.

in case of ruby , others, g-wan not useful because of api (cgi used instead) rather because of speed , ease of use (among other things 0 configuration comes mind).


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -