sbox-issues
sbox-issues copied to clipboard
[ActionGraph] Get Cookies
For?
Other
What can't you do?
No access to the cookie container in ActionGraph.
How would you like it to work?
In C# it's Cookie.Get<T>( "cookie", defaultValue );
Here's what it could look like (minus the fallback value)
What have you tried?
I made my own.
public static class CookieHelper
{
/// <summary>
/// Gets a cookie value.
/// </summary>
[ActionGraphNode( "cookie.get" )]
[Title( "Get {T}" ), Group( "Cookie" ), Icon("cookie")]
public static T Get<T>( string key )
{
return Cookie.Get( key, (T)default );
}
}
But I believe something as useful as Cookies should be in ActionGraph by default.
Additional context
No response