i got a problem in using Session. I was following many tutorials and documentations on different sites but still can't figure out how to use Session in my context.
So basically I want to use users login name during the whole session. I've read Session is the thing I need.
Did i forget to import something? Am I using it wrong?
https://i.stack.imgur.com/vwTMb.png
Can someone please help me with that?
Thank you very much in advance for your answer.
For .NET Core try:
using Microsoft.AspNetCore.Http;
then
HttpContext.Session.SetString("test key", "test value");
For .NET framework (pre .NET 5) try:
HttpContext context = HttpContext.Current;
context.Session["Test key"] = "Test value";
Este artigo é coletado da Internet.
Se houver alguma infração, entre em [email protected] Delete.
deixe-me dizer algumas palavras