Last post Sep 25, 2020 08:35 AM by PatriceSc
Sep 24, 2020 06:36 PM|KALYANA ALLAM|LINK
While using out of proc session management Couchbase as StateServer, does use of Session Variables cause any issue?
Session["UserName"] = "email@example.com";
Sep 24, 2020 06:50 PM|PatriceSc|LINK
What you store in session needs to be serializable - see
https://docs.microsoft.com/en-us/dotnet/standard/serialization/ - so that it can be saved and restored in the exact same state.
You are using
https://docs.couchbase.com/tutorials/session-storage/aspnet.html ? You tried something and got a problem?
Edit: it is also likely that Session_End won't happen. Unless you have a quite strong reason to think what you are trying to do won"t work, your best bet is likely just to try and ask if you into an actual problem.
Edit 2 : or the issue is that this is an ASP.NET Core provider while you are using ASP.NET 4.x ?
As you see it's likely easier to just try and ask for help when running into a problem rather than asking others how you could make fail something that should work when properly done.
Sep 25, 2020 07:37 AM|KALYANA ALLAM|LINK
Thanks for the information , I like to know more about Edit2 , is Couchbase not compatible with all .NET versions, the earlier website we used Visual Studion 2010(.NET 4.5) , this we use Visual Studio 2017 (.NET 4.7)
Sep 25, 2020 08:00 AM|PatriceSc|LINK
Rather than asking others how something could fail and then see if it applies to your case, it should be easier to describe which wrong behavior you see - possibly spending few minutes to understand the exact behavior - and then it should much easier to
wonder just about what could cause this particular issue.
For example here I would likely :
- track the SessionID, if changed I can then focus on why a new session is triggered
- if not checking if it happens for a single variable (unexpectedly assignment?) or them all (unexpected Clear call?)
If instead session variables seems to be mixed up accross users, I would check for an incorrect usage of static data etc...
Not directly related but I try to always store in session something that could be reloaded on demand.
Sep 25, 2020 08:24 AM|KALYANA ALLAM|LINK
I will work on tracking the session id
Sep 25, 2020 08:35 AM|PatriceSc|LINK
https://docs.couchbase.com/dotnet-sdk/3.0/hello-world/start-using-sdk.html it would be rarher 4.6.2+ but you perhaps use an older SDK ?
Not using it and can't help more. You'll have to find someone that could answer this exact question (the exact version of the SDK or session provider you are using could help).
IMO it would ne really easier to start from what you see (exceptions ? lost session variables ? data mixed accross users ?) to see at least if it's a general issue or maybe something that is really particular to CouchBase (in which case a CouchBase forum
could be better).