Click here to Skip to main content
15,911,890 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to increase session id length from 24 characters to 32 characters. I put a class file which is given below

C#
public class GuidSessionIDManager:SessionIDManager
{
    public GuidSessionIDManager()
    {
        //
        // TODO: Add constructor logic here
        //
    }
    public override string CreateSessionID(HttpContext context)
    {
        return Guid.NewGuid().ToString();

        // Here you can create your own max 80 character unique GUID ID.
    }


    public override bool Validate(string id)
    {
        try
        {

            Guid testGuid = new Guid(id);
            if (id == testGuid.ToString())
                return true;
        }
        catch
        {
        }

        return false;
    }
}


and in webconfig file

HTML
<sessionstate sessionidmanagertype="GuidSessionIDManager">


But still now i cannot change session id value. It is very urgent please help me .
Posted
Updated 16-Mar-17 6:54am
v2
Comments
Dfects 17-Mar-17 9:13am    
Don't use guid's for session ids. They're deterministic and introduce a security hole to your software.

 
Share this answer
 
v2
Comments
Raj kumar.C 20-Apr-12 4:51am    
i implemented the above solution but it does not change

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900