Hello,
I want to generate a unique ID for each page of my Asp.Net application.
My first step is to generate a new Guid when the page is loaded for the
first time and registers, stores this new Guid in a Dictionary which is saved
in the ApplicationState, then I add a hidden field to the page __PageID, so
I can get this unique ID on other Postbacks. No problem.
The problem is about hackers. They can modify my hidden field to another Guid.
What other parameters can I add to have a perfect unique ID per page ?
(I was thinking about computer info or IP address)
Thanks in advance for your help.
Peter Bromberg [C# MVP] - 12 Mar 2008 21:10 GMT
How about, perhaps, the HashCode of the Page?
--Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
> Hello,
>
[quoted text clipped - 9 lines]
>
> Thanks in advance for your help.
bruce barker - 12 Mar 2008 21:41 GMT
store the guid in viewstate as this is encrypted and validated.
-- bruce (sqlwork.com)
> Hello,
>
[quoted text clipped - 9 lines]
>
> Thanks in advance for your help.
clintonG - 12 Mar 2008 23:33 GMT
All 10,000 pages? ;-)
> store the guid in viewstate as this is encrypted and validated.
>
[quoted text clipped - 16 lines]
>>
>> Thanks in advance for your help.
Michael Nemtsev [MVP] - 12 Mar 2008 23:45 GMT
Hello Alphapage,
I'd rely on hashcode. Just render your page into string and get hashcode
from this string, and your can even encode it
---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
A> Hello,
A>
A> I want to generate a unique ID for each page of my Asp.Net
A> application.
A> My first step is to generate a new Guid when the page is loaded for
A> the
A> first time and registers, stores this new Guid in a Dictionary which
A> is saved
A> in the ApplicationState, then I add a hidden field to the page
A> __PageID, so
A> I can get this unique ID on other Postbacks. No problem.
A> The problem is about hackers. They can modify my hidden field to
A> another Guid.
A> What other parameters can I add to have a perfect unique ID per page
A> ?
A> (I was thinking about computer info or IP address)
A> Thanks in advance for your help.
A>
Alphapage - 13 Mar 2008 14:04 GMT
Thank you everyone,
I will build a custom Id with the hashcode. Great idea.
Regards.
Patrice - 13 Mar 2008 11:29 GMT
So what ? We don't know what you are using those IDs for ? So I have no idea
what would be the consequence if a hacker was changing this value. You can
always check server side against your dictionary to find out changed values.
Your best bet is likely to start by telling us what is the overall goal for
those unique ids...
--
Patrice
> Hello,
>
[quoted text clipped - 12 lines]
>
> Thanks in advance for your help.