I just had an instance where I needed to clear out the {sessions} table for testing purposes on one of my sites, and was mildly surprised that there is no way to do this with drush.

Before I submit a patch for this, are there any common use cases for this? The only ones I can come up with are

$ drush help session-delete
Delete user sessions from the database.

Examples:
 drush session-delete all                  Delete all sessions.
 drush session-delete 64                   Delete sessions for user id 64.


Aliases: sess-del

Is there anything else that would be handy?

CommentFileSizeAuthor
#3 session.patch2.05 KBmpdonadio
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moshe weitzman’s picture

Project: Drush » Drush extras
Version: » 7.x-1.x-dev
Component: Core Commands » Code

Moving to drush extras as this only has niche value IMO

greg.1.anderson’s picture

Yeah, I'd take this in drush_extras.

mpdonadio’s picture

FileSize
2.05 KB

Here is an initial version. I think I tested all of the edge cases, but I didn't get a chance to test against D6 (I don't have a D6 instance that I can mess with at the moment).

I may update this in the future to add options for --uid , --ip, and maybe --timestamp, but the only thing I have ever wanted to do for test purposes was blow away all sessions or all sessions for a particular user.

tunic’s picture

Issue summary: View changes
Status: Active » Needs review

Interesting command, fixing status to get reviewed.