Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [session-management]

Management of semi-permanent interactive information interchange between two or more communicating devices, or between a computer and user

-2
votes
1answer
52 views

Session key is the same throughout the session, can this behavior be exploited?

This application uses session key instead of CSRF token but this session key is the same throughout the session, it's not changing. It only changes if I logout and then login again to the application. ...
0
votes
0answers
29 views

Bind application user roles to JWT is good

I need implement service oriented application. so i hope to use micro services for my back end function and react for fronted end development. for session management i hope to use JWT tokens. with ...
2
votes
1answer
109 views

DTLS vs TLS sesssion

I am using an application which is sending application data using MQTT-SN application Layer protocol. I have encrypted the UDP port using DTLS. Now the question is if i have to reinitialize a ...
0
votes
1answer
43 views

How often should I reset my users' session cookies?

I am working on a Rails application where I reset the session upon logging out and each successful login, as well as when the user IP address changes. Would resetting the session (changing the ...
0
votes
2answers
79 views

Could Someone Use a Stolen Cookie Session ID to Bypass Htaccess Login?

I'm doing some pen testing for my place of employment. I was able to grab the session id from the browser cookies, but i still cannot get past the htaccess login. I initially thought that by setting ...
1
vote
1answer
59 views

Store user credentials vs store refresh token

I am currently designing a native mobile application that require user authentication and authorization to connect to a REST API. Keycloak will be used as IAM tool and tokens will be JWT. I don't ...
0
votes
1answer
97 views

Remember me feature: do we need a server side token if the cookie is signed by the server?

Every resource I find (I, II, III) about how to implement in a secure way the typical "remember me" login feature, recommends storing a user identifier and an associated unique token in the cookie, ...
0
votes
1answer
41 views

Session invalidation for 2 browsers

I have an app with the authentication using WSO2, using the scenario below: Login to the same apps with the same credentials in 2 different browsers (Chrome and FireFox) I change my password of my ...
0
votes
2answers
53 views

Cookie generation

What is the most secure was to generate cookies that makes it hard for a user to be able to guess the session cookie of another particular user or that will be accepted as a valid session cookie. ...
1
vote
1answer
75 views

Is a “logged_in” session flag secure enough?

Is the code below enough to secure a login area? <?php if ($_SESSION['logged_in']) { // show content for logged-in users } Note: $_SESSION['logged_in'] is just a boolean value true after ...
2
votes
1answer
44 views

Does embedding (concatenating) a user ID in a session token for logging have any security implications?

Assuming there's a user with ID 123456 logging into a web application where the randomly generated session identifier to be stored in the cookie looks like this 123456zXRL9DWpPtaAhkPzhemQZE5P5F (that ...
0
votes
2answers
138 views

Why not write the CSRF Token into the Session

I am currently developing a web page and came across the OWASP Cheat sheet about double submit cookies. I am now thinking that's a good idea but I didn't get why you are not storing the CSRF token ...
0
votes
1answer
80 views

Can an attacker steal information from my HTTPS page by embedding it?

If a login page, secured with https/tls redirects to another site (also secured with https/tls) with a onetime use token (expires in a minute and has a nonce) in the querystring, can this token be ...
0
votes
2answers
119 views

Authenticated Sessions on a Desktop Application

I want to implement a login into my C++ desktop application and I'm having a hard time finding information on managing login sessions without cookies or JWT (JSON Web Token) (more on that in a bit). I ...
1
vote
2answers
80 views

How to implement secure user sessions using HttpOnly cookies?

I'm creating a web application, and want to allow users to log in (and stay logged in). My plan to support this in a secure way goes as follows: User logs in from a login form - when successful, the ...
1
vote
2answers
53 views

Effects of new random Session token for each HTTP Request

On successful authentcation, a web application issues a session cookie that is a constant length string of apparently random hex characters. ...
1
vote
1answer
26 views

restoring logged out gmail session in running instance of chromium browser?

My situation is: +I have created a special purpose gmail account +I used a complicated password to protect the account. On purpose, I did not use any 2FA options are a "reset" email address or phone ...
1
vote
0answers
35 views

Rotating session names vs a static session name with a rotating validation string

I'm building my own session management library in the Go programming language and I had an interesting idea to save memory. I created something called an overseer that looks for expired and abandon ...
0
votes
1answer
72 views

Harden against privilege escalation in Microservices

Please consider the following scenario. The system has a set of business owners (i.e. users of the system) Each business owner is mapped to a set of customers The business owners login to the system ...
0
votes
2answers
1k views

JWT or session cookie for API for both web and mobile app?

I've been reading all I could about this subject for the last couple of days and I can't decide what would be the best approach. The only two requirement are: I need to know the users that are ...
0
votes
1answer
76 views

Handling race condition at the time of renewing the session

I've recently asked this question on SO. As the question was not answered yet, I've come up with an approach. But I wanted to check if there is not any security flaw in this solution. Question I had ...
0
votes
2answers
114 views

why MAC address can not be used as session identifier instead of session ID? [duplicate]

why MAC address can not be used as session identifier instead of session ID? why the physical address (MAC address) cannot be used as a session identifier during the communications between servers ...
0
votes
1answer
190 views

A different CSRF token and session ID passed in the request [closed]

A CSRF token is what a server includes in its response, that is the same token which is passed in the request from the user. In my case, a different CSRF token is getting included in the request- ...
1
vote
0answers
44 views

Generating session with id and password

Most web apps generate a long hex number and use it as a sessionid. My idea is to create an ID which is auto-incrementing for each generated session and assign it a random secure string (a password). ...
1
vote
1answer
358 views

Should client have access to 3rd party API access token?

I'm trying to determine whether to use a Token provided by a Third Party service directly, OR issue my own custom Token and store the Third Party Token server side. Authentication flow User ...
1
vote
1answer
50 views

Should you remove the user's application PIN if they explicitly log out

I am looking for some security driven insight on when to dispose of a mobile application user's PIN in a few scenarios: Background: When the user downloads and installs the mobile app, they are asked ...
0
votes
0answers
207 views

Multiple sshd sessions for single SSH login

I was grepping through /var/log/auth.log and noticed that for some reason, not every time, but sometimes when I would log in via SSH I would see entries like the following - where there were multiple ...
4
votes
2answers
572 views

Why we store session id instead of user id inside cookies?

Would not it be better to store user id instead of session id so that we only lookup database once for extracting other user info instead of twice extracting user id from session db then user db?
0
votes
1answer
101 views

How to implement machine tagging when allowing a user to “remember me” on web application? [duplicate]

The remember me cookie should identify the machine as well. So by implementing machine tagging, we will avoid a situation when an attacker tries to login with the user cookie from another machine. ...
0
votes
1answer
42 views

Best strategy to share some sensitive user data between Node and PHP

I am creating a website that is built on PHP. It has a small page where users can have a group chat and message each other. For that page I open a websocket with a help of socket.io and expressjs. I ...
1
vote
1answer
39 views

Security implications of using long lasting authentication cookies

I'm trying to find some information about potential security risks with allowing long lasting cookies for website authentication. Initially it was set to not persist the login session, so it would ...
0
votes
2answers
89 views

How many characters should a session key be?

I have a session key generator that uses only letters and number. I've looked up how long a session key should be here: https://www.owasp.org/index.php/Insufficient_Session-ID_Length and by some ...
0
votes
2answers
60 views

Are contents of PHP sessions forensically valuable?

PHP has some nice, neat builtins for dealing with sessions: there'ssession_start() and session_id() and session_destroy() functions, which work with a superglobal variable, $_SESSION, to store name/...
2
votes
0answers
551 views

Should I hash my refresh tokens before storing them in the server's database? [duplicate]

I have a service with a client app (Mac). To log in, users enter their username and password in the client app, which sends this information to the server. The server verifies this information using ...
2
votes
0answers
215 views

SAML 2 | Refresh IdP Session when user is working on SP

Wanted to discuss the solution and options to refresh the IdP Session when user is actively working on the SP. The use case is that after successful SP-Initiated SSO, there are two sessions in ...
-3
votes
2answers
390 views

Where will cookie be created. Client side ? Server side ? How it will be validated

I wanted to know where exactly a cookie be generated ie., client side / server side.Because if I intercept the request before logging into the application, Header with cookie will be displayed . So, ...
1
vote
0answers
36 views

logout all devices or only one

I wonder which is the best practice in terms of security. Assuming an application where one can login from multiple devices in parallel what I should expect from "logout" button? To logout the user ...
2
votes
2answers
421 views

Use javascript variable instead of session cookie

I have decided to plunge deep into Angular-like technologies, where all pages are practically just one page that gets never reloaded. And at this point I had the idea, instead of using cookies (which ...
3
votes
1answer
395 views

Does user-agent session tracking provide any benefit?

On a phpBB forum I manage a user has requested that we turn off the "Validate browser" setting which invalidates user sessions if they change user-agent, because they use a mod which randomises their ...
4
votes
4answers
880 views

How dangerous is storing the hashed password in local storage?

I'm looking at a web application that does something I find very unusual in the handling of login sessions. The application hashes the password with SHA256 and salt and saves it either in session ...
0
votes
0answers
14 views

TLS Session resumption for non-existing sessions [duplicate]

I have tested this multiple times: I use a fresh PC, with newly created test user (on Mac and Windows), open Incognitto Chrome and enter THE specific website address; then I see "Client Hello"s with "...
2
votes
1answer
107 views

Protecting the user from unauthorized access

So we are planning on adding a feature to our app that is similar to what Google does, but a little stricter: You have a list of sessions that are tied to a user agent and IP address(?) (google shows ...
1
vote
0answers
50 views

What are the security benefits of creating a session vs. just using Google ID token every time in my server back end?

I'm using Google Sign In to authenticate my users with my server back end via my Android app. So far I am able to sign in and obtain an ID token, which I then send to my server back end for ...
1
vote
1answer
34 views

What is this scheme called and how should it work exactly?

So I was thinking about client-server communication and how to keep this private, especially from man-in-the-middle attacks. I came up with a scheme that I'm sure exists already, but I could not find ...
1
vote
2answers
105 views

Why are third party cookies sent to second party websites?

When I visit this website, Google Analytics cookies are being sent to it from my browser along with the request. This goes against my whole understanding of cookies which is that cookies are only ...
0
votes
1answer
46 views

Work with user tokens and sessions [closed]

I am trying to develop a social media app and website. The problem is I am trying to find a secure way to work with logins and sessions since other methods don't seem good or have better ways. For ...
2
votes
3answers
180 views

Why shouldn't my client just send the user's username and password with every request?

I have a PHP server and an Android/iOS client, and SSL is used for all communication. The PHP server is a JSON API with 2 public functions (register, login) and many private functions (which require ...
-1
votes
1answer
30 views

Access Token or User Id

After logged in to application, why one should use "access token" instead of simply using "user name", to call further APIs ? How it is more secured with access token ?
0
votes
1answer
95 views

Can I use a single permanent session ID for all of a users devices?

I am working on a project where users can post. When a user logs in and the password is correct, it logs them in and checks the database. If they have a session id, it returns it, if not, it creates a ...
2
votes
1answer
312 views

Should I let the client send both the session and the user ID?

I am working on a project where users have accounts and log in using their username and password if they are correct the code returns a session id. Next time they open the app or visit the site it ...