Connecting Tech Pros Worldwide Forums | Help | Site Map

Passing data between pages?

Smokey Grindle
Guest
 
Posts: n/a
#1: Jun 23 '06
For a website that has users logged into it using sessions, its it best to
pass data between pages in session variables or through query strings?



Scott M.
Guest
 
Posts: n/a
#2: Jun 23 '06

re: Passing data between pages?


It depends on what data you are passing, how much data you are passing and
how that data will be used.

If the data needs to be secured or there will be more than 1K of data, then
QueryStrings are out. On the other hand, sessions (if not used right) can
be costly to the server and in web farm environments won't work.

The most secure and robust way is to store the data in a database.

"Smokey Grindle" <nospam@dontspamme.com> wrote in message
news:uVgDRRmlGHA.4076@TK2MSFTNGP05.phx.gbl...[color=blue]
> For a website that has users logged into it using sessions, its it best to
> pass data between pages in session variables or through query strings?
>
>[/color]


Ethan V
Guest
 
Posts: n/a
#3: Jun 23 '06

re: Passing data between pages?


My preference is to use Server.Transfer and HTTPContext.Items to pass data
between pages, and I am willing to live with out-of-sync URL. I minimize the
use of session to absolute mininal for resource conservation reason. I do
not use query string ask I don't like people hacking with the query strings.
If I were to use query string I would encrypt it.

"Smokey Grindle" <nospam@dontspamme.com> wrote in message
news:uVgDRRmlGHA.4076@TK2MSFTNGP05.phx.gbl...[color=blue]
> For a website that has users logged into it using sessions, its it best to
> pass data between pages in session variables or through query strings?
>
>[/color]


Steve C. Orr [MVP, MCSD]
Guest
 
Posts: n/a
#4: Jun 23 '06

re: Passing data between pages?


Here's another nice, simple way to pass values from one page to another:
(VB.NET code)

'Add data to the context object before transferring
Context.Items("myParameter") = x
Server.Transfer("handle_error.aspx ")

Then, in handle_error.aspx.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.Items("myParameter"),Integer)

Of course there are a number of ways to pass values from one page to another
besides the querystring there are cookies, session, context, saving to a
temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.

Here are more good articles on the subject:
http://SteveOrr.net/faq/PassValues.aspx
http://www.aspalliance.com/kenc/passval.aspx
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"Smokey Grindle" <nospam@dontspamme.com> wrote in message
news:uVgDRRmlGHA.4076@TK2MSFTNGP05.phx.gbl...[color=blue]
> For a website that has users logged into it using sessions, its it best to
> pass data between pages in session variables or through query strings?
>
>[/color]


Smokey Grindle
Guest
 
Posts: n/a
#5: Jun 23 '06

re: Passing data between pages?


well for example I need to pass this set of information from page to page
which may different pages may change the information..

Folder (path on a hierachy of data currently on, string under 200 chars)
MessageID (ID of node in the folder, Int64)
ActionGUID (Unique ID of last action performed)

besides that, not much else will be there...

"Scott M." <s-mar@nospam.nospam> wrote in message
news:Ouc8EamlGHA.2180@TK2MSFTNGP05.phx.gbl...[color=blue]
> It depends on what data you are passing, how much data you are passing and
> how that data will be used.
>
> If the data needs to be secured or there will be more than 1K of data,
> then QueryStrings are out. On the other hand, sessions (if not used
> right) can be costly to the server and in web farm environments won't
> work.
>
> The most secure and robust way is to store the data in a database.
>
> "Smokey Grindle" <nospam@dontspamme.com> wrote in message
> news:uVgDRRmlGHA.4076@TK2MSFTNGP05.phx.gbl...[color=green]
>> For a website that has users logged into it using sessions, its it best
>> to pass data between pages in session variables or through query strings?
>>
>>[/color]
>
>[/color]


Scott M.
Guest
 
Posts: n/a
#6: Jun 23 '06

re: Passing data between pages?


And what if someone hacks your querystring by forcing different data into
it?


"Smokey Grindle" <nospam@dontspamme.com> wrote in message
news:u%23ACqymlGHA.2180@TK2MSFTNGP05.phx.gbl...[color=blue]
> well for example I need to pass this set of information from page to page
> which may different pages may change the information..
>
> Folder (path on a hierachy of data currently on, string under 200 chars)
> MessageID (ID of node in the folder, Int64)
> ActionGUID (Unique ID of last action performed)
>
> besides that, not much else will be there...
>
> "Scott M." <s-mar@nospam.nospam> wrote in message
> news:Ouc8EamlGHA.2180@TK2MSFTNGP05.phx.gbl...[color=green]
>> It depends on what data you are passing, how much data you are passing
>> and how that data will be used.
>>
>> If the data needs to be secured or there will be more than 1K of data,
>> then QueryStrings are out. On the other hand, sessions (if not used
>> right) can be costly to the server and in web farm environments won't
>> work.
>>
>> The most secure and robust way is to store the data in a database.
>>
>> "Smokey Grindle" <nospam@dontspamme.com> wrote in message
>> news:uVgDRRmlGHA.4076@TK2MSFTNGP05.phx.gbl...[color=darkred]
>>> For a website that has users logged into it using sessions, its it best
>>> to pass data between pages in session variables or through query
>>> strings?
>>>
>>>[/color]
>>
>>[/color]
>
>[/color]


Smokey Grindle
Guest
 
Posts: n/a
#7: Jun 23 '06

re: Passing data between pages?


That's the point of asking whats the best method of doing this, I'm trying
to get rid of query strings, I just dont know how best to handle it

"Scott M." <s-mar@nospam.nospam> wrote in message
news:OBXhjKnlGHA.2136@TK2MSFTNGP04.phx.gbl...[color=blue]
> And what if someone hacks your querystring by forcing different data into
> it?
>
>
> "Smokey Grindle" <nospam@dontspamme.com> wrote in message
> news:u%23ACqymlGHA.2180@TK2MSFTNGP05.phx.gbl...[color=green]
>> well for example I need to pass this set of information from page to page
>> which may different pages may change the information..
>>
>> Folder (path on a hierachy of data currently on, string under 200 chars)
>> MessageID (ID of node in the folder, Int64)
>> ActionGUID (Unique ID of last action performed)
>>
>> besides that, not much else will be there...
>>
>> "Scott M." <s-mar@nospam.nospam> wrote in message
>> news:Ouc8EamlGHA.2180@TK2MSFTNGP05.phx.gbl...[color=darkred]
>>> It depends on what data you are passing, how much data you are passing
>>> and how that data will be used.
>>>
>>> If the data needs to be secured or there will be more than 1K of data,
>>> then QueryStrings are out. On the other hand, sessions (if not used
>>> right) can be costly to the server and in web farm environments won't
>>> work.
>>>
>>> The most secure and robust way is to store the data in a database.
>>>
>>> "Smokey Grindle" <nospam@dontspamme.com> wrote in message
>>> news:uVgDRRmlGHA.4076@TK2MSFTNGP05.phx.gbl...
>>>> For a website that has users logged into it using sessions, its it best
>>>> to pass data between pages in session variables or through query
>>>> strings?
>>>>
>>>>
>>>
>>>[/color]
>>
>>[/color]
>
>[/color]


Scott M.
Guest
 
Posts: n/a
#8: Jun 23 '06

re: Passing data between pages?


Well, if you see my first response, I mentioned that if security is an
issue, QueryStrings are out.


"Scott M." <s-mar@nospam.nospam> wrote in message
news:OBXhjKnlGHA.2136@TK2MSFTNGP04.phx.gbl...[color=blue]
> And what if someone hacks your querystring by forcing different data into
> it?
>
>
> "Smokey Grindle" <nospam@dontspamme.com> wrote in message
> news:u%23ACqymlGHA.2180@TK2MSFTNGP05.phx.gbl...[color=green]
>> well for example I need to pass this set of information from page to page
>> which may different pages may change the information..
>>
>> Folder (path on a hierachy of data currently on, string under 200 chars)
>> MessageID (ID of node in the folder, Int64)
>> ActionGUID (Unique ID of last action performed)
>>
>> besides that, not much else will be there...
>>
>> "Scott M." <s-mar@nospam.nospam> wrote in message
>> news:Ouc8EamlGHA.2180@TK2MSFTNGP05.phx.gbl...[color=darkred]
>>> It depends on what data you are passing, how much data you are passing
>>> and how that data will be used.
>>>
>>> If the data needs to be secured or there will be more than 1K of data,
>>> then QueryStrings are out. On the other hand, sessions (if not used
>>> right) can be costly to the server and in web farm environments won't
>>> work.
>>>
>>> The most secure and robust way is to store the data in a database.
>>>
>>> "Smokey Grindle" <nospam@dontspamme.com> wrote in message
>>> news:uVgDRRmlGHA.4076@TK2MSFTNGP05.phx.gbl...
>>>> For a website that has users logged into it using sessions, its it best
>>>> to pass data between pages in session variables or through query
>>>> strings?
>>>>
>>>>
>>>
>>>[/color]
>>
>>[/color]
>
>[/color]


Closed Thread