Sg1456
Sg1456

Reputation: 974

Simulate Session Timeout/Expiration in Chrome

I have a piece of code I need to test for a case where the user is detected via cookies, but the session has timed out. To save myself from waiting around, is there a way I can modify the session in dev tools to simulate a timeout?

I know you can completely clear a session via the application tab (shown below) but this doesn't have the desired effect for me. Wondering if there is something else hidden in dev tools that I am not aware of yet. Thanks!

Screenshot of Application tab in dev tools with emphasis on session storage

Upvotes: 6

Views: 18513

Answers (2)

Autex
Autex

Reputation: 367

Expanding Nick722's answer, how about erasing the appropriate cookie under "Cookies" instead? This worked for me when I wanted to fake a lost session.

Upvotes: 0

nick722
nick722

Reputation: 1019

You can edit expiration time in Cookies and set an expired time there.

enter image description here

Upvotes: 2

Related Questions