Questions tagged [session-cookies]

Session cookies enable a server and a browser to establish an identified connection (through cookies) and communicate though it.

Session cookies are temporary files that exist for a particular user for a pre-defined duration. Once this duration is expired, the session cookies are erased.

Session cookies allow a website to keep a state or memory of the visitor as they navigate between pages of the website.

4816 questions
7
votes
2 answers

Maintain Session While Calling an ASMX Web Service

I am using a client app to connect to a web service for authenticated user only. Here is simplest example: My web service code: public class TestService : System.Web.Services.WebService { [WebMethod(EnableSession = true)] public string…
huynhtuanh
  • 327
  • 1
  • 5
  • 17
7
votes
1 answer

How to delete a user's cookie using python on app engine?

I'm using the python facebook api on google app engine (webapp). I want to set the user's cookie to expire when the user logs out of the application. This cookie is being set by the Javascript Facebook API. Here is the facebook api function…
7
votes
3 answers

"Impersonating" session in a web service call

I am trying to write a web service that returns session variables. The application that calls this web service has access to the the Session ID of the current session. I tried doing this by creating a "ASPNet_SessionID" cookie and then attaching…
Matt Kagan
  • 611
  • 1
  • 12
  • 24
7
votes
3 answers

Delete PHP Cookie?

I currently have a cookie set as follows: setcookie("username",$username,time()+3600*24*5); How would I go about clearing the value of that cookie so that the user's username isn't filled in anymore? I have it cleared as…
Jason
  • 109
  • 1
  • 2
  • 10
7
votes
2 answers

Domain Attribute Invalid - Set Cookies

I have built a basic demo backend using nodejs and ui using reactjs. When I login in using credentials, I am trying to set cookies. But it says some things like this "this. set-cookie domain attribute was invalid with regards to the current host…
Nagendra N
  • 164
  • 1
  • 2
  • 7
7
votes
2 answers

How to set cookies in nextjs

In my next.js project,I want to set cookies when user logs in. with document.cookies(something) it is setting cookies, but it is limiting to set only one cookie. If I give more than one cookie it is taking only the first element. In both cases I am…
Logeswari
  • 387
  • 3
  • 5
  • 9
7
votes
2 answers

ASP Net Core 2.2 Session lost after redirect

I have the following session config in Startup.cs public void ConfigureServices(IServiceCollection services) { services.Configure(options => { options.CheckConsentNeeded = context => false; …
lavrik
  • 1,456
  • 14
  • 25
7
votes
1 answer

Symfony 4 session expire too soon

My php session with Symfony 4.0 expire too soon even if I set it up for several days in config/packages/framework.yaml. framework: {...} session: handler_id: ~ cookie_lifetime: 604800 {...} When the user complete the signin process, he…
7
votes
1 answer

MS Edge dropping cookie

We're experiencing a strange behaviour on MS Edge with at least versions 16/17. The same issue does not happen on IE 11/Chrome/Firefox. Our users are authenticated via a session cookie. The cookie name is "app". Other cookies involve storing a the…
Paul Cream
  • 186
  • 2
  • 14
7
votes
3 answers

HttpClient not able to access a page behind a login page

[Edit - Added analysis from fiddler, added more code to copy over authentication header] [Edit - now use FormUrlEncodedContent] I have a page here: https://www.cdc.co.nz/products/list.html?cat=5201 that is password protected via login over here:…
taylorswiftfan
  • 1,371
  • 21
  • 35
7
votes
1 answer

How to manage one Session Per Tab?

Hi I will like to imitate the behaviour of the site ClickBank.com, for example: Open the site, and login, if i open a tab with the same site, it ask me again to login. It makes me wonder how to manage one session per tab. Just to clarify, i don't…
Sanchitos
  • 8,423
  • 6
  • 52
  • 52
7
votes
1 answer

Session Cookies expire way sooner on mobile than on desktop

We're using session cookies on our website. After 8 hours they expire. On a desktop browser (Chrome, Firefox, Edge,...) this works just fine. But on the default Android browser (Chrome) they expire way sooner. (2 hours) However we make no…
J-B
  • 93
  • 2
  • 5
7
votes
2 answers

servlet set cookie secure?

javax.servlet.http.Cookie implements java.lang.Cloneable In Cookie method, there is a method call "setSecure" , what does it use for? if i setSecure(true), is there anything i need to do on my client(javascript) side to read the cookie? what is…
cometta
  • 35,071
  • 77
  • 215
  • 324
7
votes
1 answer

Using cookies/sessions for mobile application authentication?

Is there any reason why I shouldn't use cookies/sessions for native mobile applications, usually used by browsers, to authenticate with my server and for subsequent API calls? Clarification: It seems the de-facto method of authentication on mobile…
Karan
  • 1,636
  • 4
  • 19
  • 35
7
votes
4 answers

Reason to use more cookies than just a session hash for authentication?

I usually hang out in a community that uses a bulletin board software. I was looking at what this software saves as cookie in my browser. As you can see it saves 6 cookies. Amongst them, what I consider to be important for authentification…
dierre
  • 7,140
  • 12
  • 75
  • 120