ClearBox Server™ v1.2 Developer's Guide


Allows server extension to store some data associated with a packet.

HRESULT SetCookie(
	[in] long packetTag,
	[in] unsigned long cookieDataSize,	
	[in] unsigned char* cookieData);


[in] Packet unique ID. It is usually obtained by server extension in its implementation of IRADIUSAuthentication::GetChallengeResponseAttributes or IEAP::ProcessMessage (although its use is not restricted by them).
[in] Number of bytes in array pointed by cookieData.
[in] Array of bytes representing some data that server extension has to store and associate with a packet with packetTag ID.

Return Values

This method always returns S_OK.

Thread Safety

This method can be called from any thread.

Memory Management

Server extension should allocate and free memory for cookieData parameter.


This method allows to design server extension as "stateless", one that doesn't store intermediary data.

Server extension may call this method only once for a particular packetTag unless GetCookie method has been called and has erased stored data.

Example Code

This code uses m_pServer as IServer interface pointer stored in ICommonExtenderEx::InitializeEx implementation. In this example server stores 8 bytes of some data.

STDMETHODIMP CTest::GetChallengeResponseAttributes(
	long tag, AUTHENTYPE authType,
	USERINFOLITE * userInf, unsigned char * waitForAttribute,
	unsigned long * attrNumOut, RADIUS_ATTRIBUTE * * outpAttributes )
IServer2* pS2=NULL;
//QueryInterface will always succeed

BYTE* pData=(BYTE*)CoTaskMemAlloc(8);


// Call to  pS2->Release() is not necessary 

See Also

IServer2, Server services, IRADIUSAuthentication::GetChallengeResponseAttributes, IEAP::ProcessMessage, GetCookie

© 2001-2003 XPerience Technologies.

Created by chm2web html help conversion utility.