« first day (4426 days earlier)      last day (505 days later) » 

mr5
3:42 AM
Can somebody remind me what is the purpose of session store?
This answer -> stackoverflow.com/q/33897276/2304737, mentions that sessions could be stored from memory/cookie/database
Why is the database one of the option?
 
4:07 AM
session mean you need to store something that prevent the process start over from beginning, where you store them doesnt matter
 
mr5
ic, but one of the options are storing it in database, why?
 
in browser, you store session id in cookies
 
mr5
shouldn't cookie be enough?
 
depends... database is client side
cookies is.... both side, cookies will send to server every requests
personally I store only id, so cookies is good
btw if you mean session storage, data get cleared once user close the browser tab
 
mr5
ah no, I'm not referring to client side session
@nyconing this one is server side: expressjs.com/en/resources/middleware/session.html
if you store the user ID in the cookie, you don't need to look it up somewhere else, no?
 
4:36 AM
lol it is client side session, just data in server
user id you mean it was user session
 
mr5
@nyconing what kind of session data?
 
i thought you say just general normal session
 
mr5
is there other sessions?
o.O
Let's exclude the window.sessionStorage for now
 
yeah depends on your website, every new visitors created new session
 
mr5
and they can be identified by cookies alone, no?
 
4:43 AM
lets say ecommerce, a visitor add products into cart, cart session
yes, that cart session id stores in cookies
 
Hey! I'm creating a file then accessing it using the "File" static methods that open and close a stream, but it's still saying that the file is in use (which i dont think it is). This only occurs when the constructor detects that the file doesn't exist, and attempts to create a new one. I searched but couldn't find an answer that helped, so I wanted to check here before making a new post. Here's the gist: gist.github.com/SlamJammington/1ae049234b88a51af27f940040b6c1d8
 
you forgot to close
File.CreateText("WinRecord.txt").Close()
 
Thank you, I figured I had to close it, but I haven't worked with files in c# before!
 
btw if youre contansly read write a file, you should design it to retry when the file in use
 
mr5
@nyconing then what is the need to store this in database?
@SlamJammington use the using keyword for disposable objects
 
4:59 AM
@mr5 when the data that client is preparing, is huge to store in cookies
 
mr5
@nyconing why not just create an actual record for that then use the session to retrieve it?
Wouldn't it complicate things if you store a lot of data on session?
 
like a form session, the form may contains huge text or images, only send to server when user had complete fillied the form, and dont loss it when browser closed for some reason in the middle of filling
 
mr5
I think that use case can be addressed in client side
Also, browser has this feature for <form> element that if user refreshes the page, all <input> elements will persist. That does not require session and works within the tab only afaik
 
5:17 AM
it depends ... if the form need preverification or combined with other purposes
not all form uses <form>
 
mr5
then those devs are not following html semantics
 
they might doing it intended
 
mr5
but anyhow, I still don't know what drives the web technology to store session in database
 
like... the dev really really hate someone modify things by F12
or ui not in html
local storage can store more data btw it maybe useful sometime
personally i store only id in cookies
all data on server
 
5:36 AM
Actually idk which use case if the session have stores too much nonsensitive data, should stores in client until at last the server require it
It relives service congestion
 
mr5
@nyconing exactly
 
 
3 hours later…
8:59 AM
Good moaning
 
 
7 hours later…
3:31 PM
Ryan Donovan on November 28, 2022
We dig into two of the most popular API protocols to see where they work best.
 
 
5 hours later…
8:03 PM
 
 
2 hours later…
10:17 PM
[Captain Obvious] when did this happen?
 

« first day (4426 days earlier)      last day (505 days later) »