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
9
votes
3 answers

Using session_name() in PHP - Cannot Access Data

When I use: session_name( 'fObj' ); session_start(); $_SESSION['foo'] = 'bar'; Subsequently loading the page and running: session_start(); print_r( $_SESSION ); doe not return the session data. If I remove the session_name(); it works fine. Does…
Kohjah Breese
  • 4,008
  • 6
  • 32
  • 48
9
votes
1 answer

What is the advantage of using Gorilla sessions custom backend?

I want to use Redis for session management. But I can't figure out what the advantage is of using Redis as a custom back-end for Gorilla sessions package over using it directly? link to the Gorilla session package:…
Marwan
  • 627
  • 1
  • 7
  • 15
9
votes
1 answer

How secure is ASP.NET Identity session cookie?

Of course cookies can be stolen and sessions hijacked, but how secure is the encryption itself of the session cookies (in ASP.NET Identity)? Could it be manipulated with modern hardware and a little bit of time? I'm asking because I would like to…
Benjamin E.
  • 5,042
  • 5
  • 38
  • 65
9
votes
1 answer

When are session cookies deleted by the browser?

If I set a cookie as a session cookie (no expires/max-age value), when does the browser remove the cookie? I know that it is removed when the browser is closed but I'd like to know if there is ever a case where a session cookie can timeout or expire…
Evan
  • 5,925
  • 6
  • 33
  • 35
9
votes
4 answers

How to delete cookie on codeigniter

I don't know how to delete a cookie. I want is when I submit a form. The cookie is also delete. I try the delete_cookie("name") but is not working. I think because the cookie I created by javascript. Please check my code to fix this problem. This is…
wewe
  • 193
  • 1
  • 5
  • 17
9
votes
7 answers

Destroy a PHP session on clicking a link

Is this code valid? Logout
mpsbhat
  • 2,733
  • 12
  • 49
  • 105
9
votes
4 answers

How does PHP parse raw cookies into $_COOKIE?

I have an issue with cross-domain AJAX requests. Three servers are involved in this issue. We can call them A1, A2, and B. A1 and A2 are running the same application code. They are two staging instances of the same web application. B is another web…
ashgromnies
  • 3,266
  • 4
  • 27
  • 43
9
votes
9 answers

How can I manage separate session states for two different websites on the same hosting using php

I am currently developing two web sites, and debugging them by connecting to localhost. The first site is referenced with http://localhost/web1 and the second is referenced with http://localhost/web2. I have created a login script for each in…
guri
  • 662
  • 2
  • 8
  • 26
9
votes
1 answer

Is there a way to stop Symfony2 sending session cookies for certain paths?

I'm implementing a web service as part of a Symfony2 site that will be accessed using JSONp and iframes from another (static) site. When a user logs in using an iFrame, Safari doesn't keep the session, so I store the session ID in the cookies of the…
rjmunro
  • 27,203
  • 20
  • 110
  • 132
8
votes
4 answers

Session cookie versus other kinds of cookies

In Internet Explorer, for example, you can enable first party cookies, third party cookies and allow session cookies. I know the difference between: a first party cookie and a third party cookie, and a PHP session and a cookie. But what is a…
jon
  • 1,429
  • 1
  • 23
  • 40
8
votes
2 answers

Why express-session (SameSite atribute) isn't working on Chrome?

I am developing a web app with Express.js and React.js. I am using express-session but it is not working. This is how i am using it: app.use(session({ store: new MongoStore({ mongooseConnection: mongoose.connection, ttl: 365 * 24 * 60 *…
8
votes
3 answers

Codeigniter/PHP sessions security question

I'm developing a web application using Codeigniter. When a user authenticates with my site I'm currently storing their 'user-identifier' in my session cookie (which I have enabled encryption on). Several of my model classes use the value in…
Casey Flynn
  • 13,654
  • 23
  • 103
  • 194
8
votes
2 answers

Asp.Net Core - Prevent Session cookie conflict between same domain applications

I'm using ASP.Net Core 2.2. By default, session cookie is stored in a cookie named .AspNetCore.Session on a specific domain (e.g: mydomain.com). In my case I have multiple .net core applications under the domain. mydomain.com/Module1,…
maxence51
  • 994
  • 1
  • 8
  • 20
8
votes
2 answers

The question between session.gc_maxlifetime and session.cookie_lifetime

My first question in stackoverflow. Thanks in advance! I am so confused about the PHP session mechanism. I have understand the session.gc_maxlifetime by PHP - ini_set('session.gc_maxlifetime', 5) - Why it doesn't end the session?. But I still don't…
Ruiwant
  • 417
  • 11
  • 25
8
votes
2 answers

Rack Session Cookie and Sinatra - setting and accessing data

I was using Rack Session Pool, however my users would get kicked off one webserver thread onto another making the session data expire. I started toying around with just enable :sessions in Sinatra, however I am unable to use that because I have…
nictrix
  • 1,483
  • 1
  • 17
  • 34