Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3598936
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:18:17+00:00 2026-05-18T20:18:17+00:00

For a specific controller action I want to turn off cookies. I’ve tried to

  • 0

For a specific controller action I want to turn off cookies. I’ve tried to remove the cookie Map, but that doesn’t seem to work. I need to completely remove all response headers except my own.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:18:18+00:00Added an answer on May 18, 2026 at 8:18 pm

    I managed to wrap the response with a wrapper with response.current.set(new CookieLessResponseWrapper(response.current())). Works ok for me.

    Here is the code for the Response wrapper if anyone is interested.

    package helpers;
    
    import play.mvc.Http.Response;
    
    public class CookieLessResponseWrapper extends Response {
        private Response wrappedResponse;
    
        public CookieLessResponseWrapper(Response response) {
            this.wrappedResponse = response;
        }
    
        @Override
        public void accessControl(String allowOrigin, boolean allowCredentials) {
            wrappedResponse.accessControl(allowOrigin, allowCredentials);
        }
    
        @Override
        public void accessControl(String allowOrigin, String allowMethods,
                boolean allowCredentials) {
            wrappedResponse.accessControl(allowOrigin, allowMethods, allowCredentials);
        }
    
        @Override
        public void accessControl(String allowOrigin) {
            wrappedResponse.accessControl(allowOrigin);
        }
    
        @Override
        public void cacheFor(String etag, String duration, long lastModified) {
            wrappedResponse.cacheFor(etag, duration, lastModified);
        }
    
        @Override
        public void cacheFor(String duration) {
            wrappedResponse.cacheFor(duration);
        }
    
        @Override
        public String getHeader(String name) {
            return wrappedResponse.getHeader(name);
        }
    
        @Override
        public void print(Object o) {
            wrappedResponse.print(o);
        }
    
        @Override
        public void removeCookie(String name) {
            wrappedResponse.removeCookie(name);
        }
    
        @Override
        public void reset() {
            wrappedResponse.reset();
        }
    
        @Override
        public void setContentTypeIfNotSet(String contentType) {
            wrappedResponse.setContentTypeIfNotSet(contentType);
        }
    
        @Override
        public void setCookie(String name, String value, String domain,
                String path, Integer maxAge, boolean secure, boolean httpOnly) {
        }
    
        @Override
        public void setCookie(String name, String value, String domain,
                String path, Integer maxAge, boolean secure) {
        }
    
        @Override
        public void setCookie(String name, String value, String duration) {
        }
    
        @Override
        public void setCookie(String name, String value) {
        }
    
        @Override
        public void setHeader(String name, String value) {
            wrappedResponse.setHeader(name, value);
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to increase the request timeout for a specific controller action in my
I have a specific changeset that I want to rollback my Development branch to,
I'd like to have URLs that are even shorter than /{Controller}/{Action}/{Id}. For example, I'd
I want to redirect from an action in one controller to an action in
I'm trying to create a route to a specific controller/action which needs to accept
I'm trying to implement a Cache Sweeper which would filter a specific controller action.
I need a method of inserting javascript which is controller/action specific into a layout.
XP-specific answers preferred, but others are welcome too.
I think this is specific to IE 6.0 but... In JavaScript I add a
Is there a specific pattern that developers generally follow? I never really gave it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.