Welcome Guest, Not a member yet? Register   Sign In
Guidance Needed
#1

[eluser]Uresh Patel[/eluser]

I have one requirement like i need to display 5 fields of a login user on every page of website.
(Name,DOB,Age,Nationality,Height)
I am not sure to which way i need to choose from.I think of 2 ways here.

1. I store 5 fields in session at time of login

2. I create a model method that gives all this data and call that from all controller.method through of the site.
#2

[eluser]jairoh_[/eluser]
why on every page? well if that is ur case u can use javascript or jquery. u write it only once ( could be on the footer, just hide it.) i
would that if i were u.
#3

[eluser]Uresh Patel[/eluser]
[quote author="jairoh_" date="1366095222"]why on every page? well if that is ur case u can use javascript or jquery. u write it only once ( could be on the footer, just hide it.) i
would that if i were u.[/quote]
#4

[eluser]TheFuzzy0ne[/eluser]
I think I'd store it in the session.

It's only a relatively tiny amount of data (around 100 bytes?), so it should be fine in a cookie. If you have database sessions enabled, that's even better yet.
#5

[eluser]Uresh Patel[/eluser]
Hi,
Thank you for reply.
I have stored that data in session.Looks good.But then i found another issue like when user will update records of profile that will not show updated data on left bar.Coz it already stored login time session data.
Or i need to update session data at time of update profile...

[quote author="TheFuzzy0ne" date="1366129431"]I think I'd store it in the session.

It's only a relatively tiny amount of data (around 100 bytes?), so it should be fine in a cookie. If you have database sessions enabled, that's even better yet.[/quote]

#6

[eluser]jairoh_[/eluser]
[quote author="Uresh Patel" date="1366183970"]Hi,
Thank you for reply.
I have stored that data in session.Looks good.But then i found another issue like when user will update records of profile that will not show updated data on left bar.Coz it already stored login time session data.
Or i need to update session data at time of update profile...

[quote author="TheFuzzy0ne" date="1366129431"]I think I'd store it in the session.

It's only a relatively tiny amount of data (around 100 bytes?), so it should be fine in a cookie. If you have database sessions enabled, that's even better yet.[/quote]

[/quote]
then update the session when the user updates the record Big Grin




Theme © iAndrew 2016 - Forum software by © MyBB