Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,

I need to add a new cookie that randomly changes for each login attempt. I need to generate different session id before and after the successful authentication. Also every request after the successful authentication should be associated with an extra session identifier cookie which also randomly changes and expire when user logs out from the application or closes the browser.

Thanks
Posted
Updated 30-Jul-14 21:16pm
v2
Comments
Thanks7872 31-Jul-14 3:09am    
Tag the question properly.
demoninside9 31-Jul-14 3:16am    
I edited.
Thanks7872 31-Jul-14 3:20am    
Still not clear.

1 solution

As per my understand, you are required different session Id's for each operation performed on the authentication. If it so, you can use "GUID" class to generate a random value and store it either in the cookie or session.
 
Share this answer
 
Comments
demoninside9 31-Jul-14 3:36am    
could you please explain more? I never did this before.
Kumarbs 31-Jul-14 4:59am    
What you are expecting, creating a guid value or solution to your question. If it is regarding guid, You can create it like following.

string s = Guid.NewGuid().ToString();

You can store the value either in session or cookie and continue with your logic.

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