Is using Hub sites the new way of having sub-sites

I am working on a new sharepoint online project. and we need to build the following:-

  1. have a main intranet site. where users can publish news, events and general documents and templates.
  2. to have separate sites or sub-sites for each department. such as HR,IT, Finance, etc..

now i was planning to follow the traditional way of doing things, mainly by:- 1. create a new classic team site (mainly to use the built-in root site collection). 2. to create separate classic team sub-sites for our departments.

but recently i read about Hub sites, and it is been mentioned that using hub sites should be the new/modern way of having sub-sites… so i am not sure if for my above case i should follow having classic team site and classic sub-sites? OR i should use Hub sites and have departments’ site collections that are linked to the hub site?

Is there a way to get CSOM ClientContext by having cookies and a Form Digest?

I have been trying to do an interesting proof-of-concept/experiment

  1. Get SharePoint user’s cookies from the browser
  2. Pass these cookies to an Azure Function
  3. By having cookies only – determine who the user is (+)
  4. Run GET/POST REST queries using user’s permissions (+)
  5. Run C#/CSOM code using user’s permissions (-)

This might be a very nice approach that works very well without the need for some nasty adal.js+iframe solutions that only work with Graph API and don’t work with Azure functions.

So, basically, I’m stuck with the last task #5. I have cookies and I have FormDigest, but I don’t know how to get CSOM ClientContext using this information. Is it even possible? Can someone, please help me with it? I will be really obliged for any tips.

I’m including a working code below. You can insert your own cookies there to try it out.

class Program {     static void Main(string[] args)     {         AsyncMain(args);         Console.ReadKey(false);     }      static async void AsyncMain(string[] args)     {         string baseurl = "https://contoso.sharepoint.com";         string rtFa = "REUSED_RtFA_Cookie";         string fedAuth = "REUSED_fedAUTH_COOKIE";          var digest = await GetDigest(baseurl, rtFa, fedAuth);          var baseAddress = new Uri(baseurl);         var cookieContainer = new CookieContainer();         using (var handler = new HttpClientHandler() { CookieContainer = cookieContainer })         using (var client = new HttpClient(handler) { BaseAddress = baseAddress })         {             client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));             client.DefaultRequestHeaders.Add("X-RequestDigest", digest);              cookieContainer.Add(baseAddress, new Cookie("rtFa", rtFa));             cookieContainer.Add(baseAddress, new Cookie("FedAuth", fedAuth));              StringContent bodyContent = new StringContent("{\"__metadata\":{\"type\":\"SP.Data.ArtefactsListItem\"},\"Title\":\"NEW VALUE2\"}");             bodyContent.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json;odata=verbose");             var result = client.PostAsync("/_api/web/Lists/getByTitle('Artefacts')/items", bodyContent).Result;             var contents = await result.Content.ReadAsStringAsync();             result.EnsureSuccessStatusCode();             Console.WriteLine("SharePoint List Item Created using REST");         }          // TODO: Awesome! We can do REST calls using user's cookies, but it's much easier if we could somehow do it using CSOM. How do we get ClientContext from cookies and a Form Digest?         using (var context = new ClientContext(baseurl))         {             // TODO: I want get SPContext having user's cookies and Form Digest:             context.Credentials = new SharePointOnlineCredentials("", new System.Security.SecureString());             context.Load(context.Web, web => web.Title);             context.ExecuteQuery();             Console.WriteLine("Your site title is: " + context.Web.Title);         }     }      static async Task<string> GetDigest(string baseUrl, string rtFa, string FedAuth)     {         var baseAddress = new Uri(baseUrl);         var cookieContainer = new CookieContainer();         using (var handler = new HttpClientHandler() { CookieContainer = cookieContainer })         using (var client = new HttpClient(handler) { BaseAddress = baseAddress })         {             client.DefaultRequestHeaders.Add("Accept", "application/json; odata=verbose");             cookieContainer.Add(baseAddress, new Cookie("rtFa", rtFa));             cookieContainer.Add(baseAddress, new Cookie("FedAuth", FedAuth));              var bodyContent = new StringContent("", Encoding.UTF8, "application/json");             var result = client.PostAsync(baseUrl+ "/_api/contextinfo", bodyContent).Result;             var contents = await result.Content.ReadAsStringAsync();               result.EnsureSuccessStatusCode();             dynamic response = JsonConvert.DeserializeObject(contents);             dynamic d = response.d;             string digest = d.GetContextWebInformation.FormDigestValue;              return digest;         }     } } 

Having a problem creating a back link

I am trying my hand at this and so far I $ uck I am trying to make a back link from Tumblr to a site.google.com that points to my money site. Problem is I can't get the link to work with the Site.google.com to work..

This is what it looks like <a herf="your website URL>my key word</a>

I can get the link right when it's straight to my website but I seem to have a problem making it work with the site.google.com

Any feed back would be great

Javascript Loops – having trouble with calculations

import java.util.Scanner; import javax.swing.JOptionPane; public class Homework_Four {         static Scanner  scan = new Scanner(System.in); //declaring variables         private static String name,jOptionInput;         private static int menuChoice,quantity,totalQuantity=0;         private static double price=0,saleTax=0,totalAmount;                       public static void main(String[] args) {         javax.swing.SwingUtilities.invokeLater(new Runnable() {         public void run(){...
PHP:

Javascript Loops – having trouble with calculations

When having set a submit limit and pause, why not search new links?

Hi @Sven   when you set a limit in settings (example 50 submission, then pause 30 minutes). 
Why not search in those 30 minutes for new links? I noticed there was 0% cpu usage and only 120Mb/ram when it was on verify (P) status. 

so I assumed the entire process is idle? not 100% sure though, but if it is, I think it would be interesting if in that break it could verify links, or even more interesting is search new sites.

Rebuilding indexes for a partitioned table having 300 partitions


Scenario

Partitioned table is empty and I am loading data for 1 partition which has 180k rows. I disabled the indexes and loaded the data and rebuilt the indexes after data is loaded.

Issue

While examining the query plan of rebuilt indexes, I can see the ‘Estimated number of rows’ is 180k but ‘number of rows read’ is 300 partitions * 180,000 rows = 54 Million rows, even though I am loading data for only one partition.

Can you shed some light on this behavior and how to overcome this issue?