How to return user name from vibed session?

Suliman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 10 04:30:51 PST 2015


On Thursday, 10 December 2015 at 12:21:40 UTC, Adrian Matoga 
wrote:
> On Thursday, 10 December 2015 at 11:36:20 UTC, Suliman wrote:
>> Vibed have method get for user session 
>> http://vibed.org/api/vibe.http.session/SessionStore
>>
>> I set user name for session like this:
>> req.session.set("username", "admin");
>>
>> But I can't understand how to get user name from it:
>>
>> abstract std.variant.VariantN!(20) get(
>>   string id,
>>   string name,
>>   lazy std.variant.VariantN!(20) defaultVal
>> );
>>
>> What does every string here mean? Could anybody to show 
>> example of usage?
>
> I think what you need is Session.get, not SessionStore.get:
>
> http://vibed.org/api/vibe.http.session/Session.get

Give me example please


More information about the Digitalmars-d-learn mailing list