Cookie generation and validation

How do we generate and validate cookie in apigee?

@dknezic @dchiesa1 @srinandans 

0 3 159
3 REPLIES 3

Generally you don't create cookies or validate cookies in Apigee. Apigee isn't targeted to support general HTTP browser clients, and cookies.

What problem are you really trying to solve?

We are currently generating UUID using javascript. Planning to use cache for storing the cookies. 

cookie will have two types of timeouts: expiry timeout, idle timeout.

We need to have logic for cookie to expire for both. And all the extra logic for cookie generation and validation.

Any efficient way to perform all these?

@dchiesa1 

I don't think there is a good way to use Apigee to set and expire cookies.  Maybe you are looking for an app server? 

Apigee has a cache, and it has a TTL or expiry. There is no way to have an idle timeout, that I can think of. 

You might try building it via an ExternalCallout. That might work for you. But that external callout would need access to a a shared cache. 

Why do you need cookies? 

Apigee has an API-oriented feature set.  keys and tokens are nicely supported. Cookies are not. Cookies are not widely used in APIs, but rather for web pages. That's why I suggest that if you really want cookies, maybe you ought to consider using an App server, or some other platform or system that is designed to run web apps.