Questions tagged [asp.net-session]

85 questions
164
votes
5 answers

How can I set the Secure flag on an ASP.NET Session Cookie?

How can I set the Secure flag on an ASP.NET Session Cookie, so that it will only be transmitted over HTTPS and never over plain HTTP?
Alex
  • 75,813
  • 86
  • 255
  • 348
118
votes
10 answers

What is the difference between Session.Abandon() and Session.Clear()

What is the difference between destroying a session and removing its values? Can you please provide an example demonstrating this? I searched for this question, but don't grasp total answer. Some answers are: Session.Abandon() destroys the…
backdoor
  • 1,185
  • 2
  • 8
  • 6
65
votes
10 answers

How to clear out session on log out

I redirect the user to the login page when user click log out however I don't think it clears any application or session because all the data persisted when the user logs back in. Currently the login page has a login control and the code behind on…
Jack
  • 9,843
  • 23
  • 78
  • 111
16
votes
3 answers

ASP.NET session state provider in Azure

As far as I know, the current situation is this: Use SQL session state provider is possible (as I've read somewhere) but it's not supported by Microsoft. So it could stop working in the future. Also it needs a WorkerRole to delete the outdated…
vtortola
  • 34,709
  • 29
  • 161
  • 263
11
votes
1 answer

Session ID not random enough - ASP.NET

UPDATE We eventually had a meeting with some programmers on the Acunetix team and they realized there may be a few bugs in their code that are causing this to be displayed in the scan as more of an issue than it actually may be. The general…
ryanulit
  • 4,983
  • 6
  • 42
  • 66
7
votes
1 answer

Cookies received from Server is Secure But Cookies sent to Server is not secure ASP.NET

In my ASP.NET Web application, i have made the below changes to make the ASP.NET_SessionID and .ASPXAUTH Cookies Secure by adding the below entries to web.config and adding the below tag…
Rajesh
  • 83
  • 1
  • 7
7
votes
3 answers

How to deal with session left open

I am implementing a session structure. I have a ConcurrentDictionary on server side holding on to all the pairs. When a new connection is established a cookie is assigned to a client browser, perm or temp depending on the…
Tom
  • 15,781
  • 14
  • 69
  • 111
7
votes
5 answers

ASP.NET MVC 3 - Dealing with Session variables

I have an app which uses Form's Authentication and when the user log's in, I retrieve the user's actual name and assign that to a session variable, like so: [HttpPost] public ActionResult LogOn(LogOnModel model, string returnUrl) { if…
CallumVass
  • 11,288
  • 26
  • 84
  • 154
5
votes
1 answer

Out of proc SessionState memory management

We're using an out-of-proc session state service/ASP.Net Session state. We know were having problems with this as it's been abused in the past, too much stored in session state too often, so were in the process of moving onto a more scalable…
Liam
  • 27,717
  • 28
  • 128
  • 190
5
votes
1 answer

How to get a session value in cshtml file in ASP.Net MVC4

Pls help me out, the value is storing in the session for the particular user ,When i am retrieving the session value from cshtml, It is showing the PC-username instead of the particular username present in the data base. please suggest session code…
Vetri
  • 77
  • 2
  • 3
  • 10
4
votes
0 answers

Sharing Session between ASP.NET Forms and ASP.NET Core

I have an existing ASP.NET Forms web application that uses RedisSessionProvider. This is setup via just the WebConfig with the following.
Hendel
  • 53
  • 5
4
votes
3 answers

Windows Azure Cache Preview

I'm having some trouble using Windows Azure Cache Preview. I've add the Nuget Package here: http://nuget.org/packages/Microsoft.WindowsAzure.Caching and have configured my role for storing the ASP.NET sessions state as per the info on…
Alex Guerin
  • 2,336
  • 10
  • 36
  • 53
3
votes
1 answer

how to logout the user from my asp.net application?

I'm using custom code to login and logout the user in my web application. on click of the login button, the code below executes: if (Membership.ValidateUser(txtUserEmail.Text, txtUserPass.Text)) { …
MrClan
  • 6,402
  • 8
  • 28
  • 43
3
votes
1 answer

Can I store Session state in my ASP.NET MVC app's existing SQL Azure DB?

I'm using EF4.1 in code-first style to persist POCO objects for a small ASP.NET MVC 3-based webapp in an SQL Azure DB 'MyAppsDB'. The tables are automatically created in MyAppsDB when they don't exist. I'd like to host the app on SQL Azure, but I…
Seth
  • 2,712
  • 3
  • 25
  • 41
3
votes
2 answers

Type '' in Assembly '' is not marked as serializable. linq-to-sql

I am using asp.net and have configured the sessions to stored in SQL server. My porject has many object and several linq-to-sql dbml's. I have configured all the them to have unidirectional serialization and also made a few customized…
ChampChris
  • 1,565
  • 5
  • 26
  • 44
1
2 3 4 5 6