This project is archived and is in readonly mode.

#1369 ✓wontfix
Michael King

Add ability to discard session

Reported by Michael King | November 13th, 2008 @ 08:15 PM | in 2.x

The ability to turn sessions off for controllers or actions works well, but what about the times when partially through an action you realize that you no longer need the session. At the moment the best you can do is reset the session and then an empty session is saved. I am proposing adding a new function called discard_session which will discard the current session the same way a reset will and create a new hash as if sessions were disabled.

Comments and changes to this ticket

  • Daniel Schierbeck

    Daniel Schierbeck November 14th, 2008 @ 01:35 PM

    When you write words = phrase.to_s.dup.split(" "), it seems that dup is redundant, and adds an unnecessary extra memory consumption. split is not destructive, and can safely be called on phrase.to_s.

  • Daniel Schierbeck

    Daniel Schierbeck November 14th, 2008 @ 01:36 PM

    I'm sorry, I accidentally commented on the wrong ticket. My apologies.

  • DHH

    DHH November 16th, 2008 @ 03:10 PM

    Michael, could you give me a use case for when this would be something you were interested in doing?

  • josh

    josh December 15th, 2008 @ 09:38 PM

    • State changed from “new” to “wontfix”

    There will be some major changes coming to sessions in 2.3. You'll be able to discard a session simply by setting the session to an empty hash. "session = {}"

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages