Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Add ability to discard session

#1369

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.

Reported by Michael King · November 13th, 2008 @ 08:15 PM

State: wontfix
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Daniel Schierbeck
    Daniel Schierbeck

    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.

    November 14th, 2008 @ 01:35 PM

  2. Daniel Schierbeck
    Daniel Schierbeck

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

    November 14th, 2008 @ 01:36 PM

  3. DHH
    DHH

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

    November 16th, 2008 @ 03:10 PM

  4. josh
    josh
    • 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 = {}"

    December 15th, 2008 @ 09:38 PM